Clarifying a simple telnet/ssh script

Rowby Goren
Rowby Goren used Ask the Experts™
on
Hi  

I don't do shh much :).   Today I got some instructions to do a command to adjust permissions.  Below is their instructions, with some key directories changed for obvious  privacy and security reasons.

Here is how you can reset the ownership of files created by apache, so you can delete them.

ssh to the server and

$ sudo blahblah-bananas.sh <path>

where <path> will be:

/www/foobar/docroot/oranges OR, (for everything)

This script makes EVERY file writeable by both human and machine 

Open in new window


When I telnet/ssh in I see a screen that already starts with the $ sign. (Specifically

[rowby@foobar ~]$ 

Open in new window

 Do I repeat that $ sign?

And do I put a space before the /www/foobar/docroot/oranges OR

In other words, can someone give me the EXACT command, including the path, to type into the dialog box in order to get it to work.

I hope I have given you enough info!

Thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
$ means prompt --Don't put it again.

 You do ssh <ADDRESS> to logon to the server

Then you are on the remote machine.  You run a script using sudo, which gives you authority to run as a root -- super user.
>> And do I put a space before the /www/foobar/docroot/oranges OR
You mean before /www?

Does not matter at all.

What are you trying to make executable.

Could you should me output of command

cat  /www/foobar/docroot/oranges
Here are your commands:

First login to the server.

ssh SERVER_NAME

Then enter command

sudo blahblah-bananas.sh  /www/foobar/docroot/oranges

Yes, you need to put space before /www because there is another command before it.


Become a Microsoft Certified Solutions Expert

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

Author

Commented:
Thanks farzanj

Here's a screen shot of how far I have gone so far.  

Getting "command not found" Screenshot
I don't think you should do "OR" at the end of lines

Did you do ssh before running commands?

It is simply saying that the shell script doesn't exist.  may be you are not on the correct directory.

Author

Commented:
Hi

I got rid of the "OR".

Did you do ssh before running commands?
I am logging in using Bitvise, under the SSH tab.  

It is simply saying that the shell script doesn't exist.  may be you are not on the correct directory.
I assumed I was in the correct directory to do the command, based on the person's instructions to me (see the initial question I posted. )   When you log iin va ssh do you usually start in the document root?  
 
Would blahblah-bananas.sh  be a script (with that sh extension) that the person would have put in that folder?  Perhaps you are right and it is not in the folder I initially sshed into.  Maybe he put it in the document root????

In case the sh script is in the document root, can you tell me the command to get to the document root?

Here is my latest screen shot.

 Screenshot
When you do

cd


If you are talking about docroot,

you need cd /wwHIDDEN IN YOUR MESSAGE/docroot

you go to the root of a particular user.

you can issue this command

locate <scriptName>

to find the script.  Then you should issue command like

sudo /path/script/name /SOMETHING/docroot/

If locate doesn't work, issue this command

find /www -type f -iname 'script.sh'

Author

Commented:
Also you might try using this editor:

http://extensions.joomla.org/extensions/edition/editors/90

It's a quick install.  

Author

Commented:
Sorry for that previous post -- I meant it for a different experts exchange response to a question!

Author

Commented:
Thanks for your help.  I contacted tech support an the command was not in the directory.  They put it in, and I ran your version of the command and it did he permission change.

I appreciate you help!

Rowby

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial