sshpass ssh登录时自动输入密码
安装
- 直接安装
sudo apt-get install sshpass
- 源代码安装
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
直接登录或通过脚本登录
#!/bin/bash
sshpass -p "XXX" ssh user@IP