wget
tar -zxvf sshpass-1.04.tar.gz
cd sshpass-1.04
./configure --prefix=/usr
make;make install
[root@Server sshpass-1.04]# ssh 先执行这一步,要不然不能登录
The authenticity of host '10.88.12.89 (10.88.12.89)' can't be established.
RSA key fingerprint is b7:3c:ac:db:24:ee:ab:56:96:be:53:c9:e6:f5:71:a1.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '10.88.12.89' (RSA) to the list of known hosts.
password:
Permission denied, please try again.
password:
[root@Server sshpass-1.04]# sshpass -p root ssh
Last login: Thu Jul 2 15:25:11 2009 from 10.88.12.11
[root@localhost ~]# w
16:43:36 up 7 days, 3:19, 2 users, load average: 0.00, 0.00, 0.00
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root pts/3 10.88.12.11 15:25 4:18 0.43s 0.43s -bash
root pts/4 10.88.12.99 16:43 0.00s 0.05s 0.00s w
注:
把 StrictHostKeyChecking no加到/etc/ssh/ssh_config可以让ssh客户端自动接受新主机的hostkey,不用每次都自己输入yes
阅读(1653) | 评论(0) | 转发(0) |