Passing SSH a password through command line
Hello,
I am writing a script to get hardware information of a particular UNIX machine. To do this, I ftp a shell script (commands to get h/w information) to the target machine and then use SSH to remote the remote script. With FTP, I can pass a password accepted as input the shell script. How can I pass the same password to SSH ? This is because I do not want the user to enter the password twice. I am not worried about the password security. Thanks |
|
ssh has methods to allow you to log into a machine from a specific account without a password.
See http://www.cit.griffith.edu.au/~anth.../ssh_howto.txt Their are also wrapper programs (like expect) that will wrap the command in a fake TTY so that you can again pipe a password into the command, while the command thinks it is getting it from a users TTY. See... http://www.cit.griffith.edu.au/~anth...eractive.hints Where I wrote down tips and solutions to controlling interactive programs. |
One common way to use "ssh" without requiring a password on the command line is to use a pair of authentication keys. Here are two links describing this:
http://linuxproblem.org/art_9.html http://www.debian-administration.org...ad_of_password 'Hope that helps .. PSM |
Hi All,
Thanks for the replies. I can aware of ssh-keygen but I do not want to use that since there are several 100 machines I want to connect to and dont want to do this for all machines. I tried expect but I get an error command not found Thanks |
Quote:
Have you read the thread I linked to in post #2? Have a look at sshpass. Kind regards, Eric |
All times are GMT -5. The time now is 07:22 AM. |