SSH登录时指定密码

下载sshpass

http://sourceforge.net/projects/sshpass/

安装

1
2
3
4
5
[root@localhost ~]# tar -zxvf sshpass-1.06.tar.gz -C /root/install/
[root@localhost ~]# cd /root/install/sshpass-1.06
[root@localhost sshpass-1.06]# ./configure
[root@localhost sshpass-1.06]# make
[root@localhost sshpass-1.06]# make install

使用

1
[root@localhost ~]# sshpass -p 123456 ssh root@121.40.66.176