ssh
两个ssh的实用小功能 长连接和脚本输入密码
长连接
修改本地的ssh配置文件
vim /etc/ssh/sshd_config
增加 TCPKeepAlive yes
自动输入密码
利用系统工具expect自动交互
编辑ssh连接脚本
#!/usr/bin/expect
#ssh服务器
spawn ssh -luser xxx.xxx.xxx.xx
#服务器返回的请求输入密码的字串
expect "user@xxx.xxx.xxx.xxx's password:"
#设定输入的密码 \r表示输入结束
send "xxxxxx\r"
#允许交互
interact