I'm using sshpass to pass the password non-interactive on ubuntu 11.04.
when I use sshpass with scp
sshpass -p '123' scp [email protected]:/home/sayuj/examples.desktop ~/Desktop/
it works fine
but it doesn't work with ssh
sshpass -p '123' ssh [email protected]
What could be the problem and how do I fix it?
Maybe do you need -o stricthostkeychecking=no
like this
sshpass -p $PASSWORD ssh -o stricthostkeychecking=no user@domain "command1;command2;"
New sshpass version 1.05 works with the latest ssh client. It is included in the Ubuntu 12.04 Precise Pangolin.
For older Ubuntu (or other Linux distros) you can get the sources from:
http://sourceforge.net/projects/sshpass/files/sshpass/1.05/
untar with:
tar xvzf sshpass-1.05.tar.gz
build:
cd sshpass-1.05
./configure
make
and use the created binary sshpass.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With