954,515 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Very Simple Scripting Question

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

badmoons
Newbie Poster
2 posts since Sep 2006
Reputation Points: 10
Solved Threads: 0
 

try adding \. at the end to take you to the root directory.

extofer
Posting Whiz in Training
239 posts since Aug 2005
Reputation Points: 8
Solved Threads: 6
 

Thanks for the reply. No dice, though. It does the exact same thing.

-J

badmoons
Newbie Poster
2 posts since Sep 2006
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You