Question Details

Browse

ssh in linux shell script

By Charles Dalton - Aug. 08, 2008

I want to use ssh in my script and hardcode username,password. I tried with SSH_ASKPASS, but i dont know how to do it and i dont want to go with rsa/dsa keys. Any suggestions?


Answers

Add Answer
  1. By Taylor Jing on Aug. 08, 2008

    I would suggest would be publickey authentication. This way you won't be prompted for any password. But since you don't want to go down that road, the other option that I have had success with is using "expect". It is a separate interpreter from your shell (i.e. bash, ksh, csh) that you will have to install, but it's easy. If you google "expect ssh password" you should see many examples of how to use expect to enter your password for you.


    0 Votes
Share your knowledge