Link to home
Start Free TrialLog in
Avatar of Rowby Goren
Rowby GorenFlag for United States of America

asked on

Clarifying a simple telnet/ssh script

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
Avatar of farzanj
farzanj
Flag of Canada image

$ 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
ASKER CERTIFIED SOLUTION
Avatar of farzanj
farzanj
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Rowby Goren

ASKER

Thanks farzanj

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

Getting "command not found" User generated image
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.
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.

 User generated image
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'
Also you might try using this editor:

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

It's a quick install.  

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

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