Very Simple Scripting Question

Reply

Join Date: Sep 2006
Posts: 2
Reputation: badmoons is an unknown quantity at this point 
Solved Threads: 0
badmoons badmoons is offline Offline
Newbie Poster

Very Simple Scripting Question

 
0
  #1
Sep 20th, 2006
Greetings,

I am trying to create a script that does 2 things. I imagine this can be done in 2 or 3 lines.

1. ssh to a server
2. execute the passwd command

here is what I am trying -

ssh -l username server
passwd

Once the script ssh's to the server, it tries to chdir to my home directory. I have no home directory on the server, only ssh access, so it gives the error - Could not chdir to home directory : No such file or directory.

The script stops there and does not execute the passwd command. If I type "passwd", it successfully executes.

Can anyone help me figure out how to do this?

Thank you.

-J
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 239
Reputation: extofer is an unknown quantity at this point 
Solved Threads: 5
extofer's Avatar
extofer extofer is offline Offline
Posting Whiz in Training

Re: Very Simple Scripting Question

 
0
  #2
Sep 20th, 2006
try adding \. at the end to take you to the root directory.
Reply With Quote Quick reply to this message  
Join Date: Sep 2006
Posts: 2
Reputation: badmoons is an unknown quantity at this point 
Solved Threads: 0
badmoons badmoons is offline Offline
Newbie Poster

Re: Very Simple Scripting Question

 
0
  #3
Sep 21st, 2006
Thanks for the reply. No dice, though. It does the exact same thing.

-J
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Shell Scripting Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC