# 源码包安装
wget http://sourceforge.net/projects/sshpass/files/sshpass/1.05/sshpass-1.05.tar.gz
tar xvzf sshpass-1.05.tar.gz
cd sshpass-1.05.tar.gz
./configure
make
make install
# yum安装
yum -y install sshpass
使用前提:对于未连接过的主机。而又不输入yes进行确认,需要进行sshd服务的优化:
# vim /etc/ssh/ssh_config StrictHostKeyChecking no
# vim /etc/ssh/sshd_config GSSAPIAuthentication no UseDNS no
# service sshd restart