wget http://sourceforge.net/projects/sshpass/files/sshpass/1.05/sshpass-1.05.tar.gz
tar xvzf sshpass-1.05.tar.gz
./configure
make
sudo make install
安装好之后,使用sshpass命令,得到如下:
Usage: sshpass [-f|-d|-p|-e] [-hV] command parameters
-f filename Take password to use from file
-d number Use number as file descriptor for getting password
-p password Provide password as argument (security unwise)
-e Password is passed as env-var "SSHPASS"
With no parameters - password will be taken from stdin
-h Show help (this screen)
-V Print version information
At most one of -f, -d, -p or -e should be used
于是把sshpass和ssh命令集合就能实现ssh登录的时候加入密码了,这样把登录某台计算机的命令写成shell脚本,后面就十分的方便了