sshpass not working properly

Sayuj picture Sayuj · Jun 28, 2011 · Viewed 23.2k times · Source

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?

Answer

mmm picture mmm · Jun 6, 2012

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.