自动登录远程服务器shell
#!/usr/bin/expect -f set user username set host ipaddress set password pwd set timeout -1 spawn ssh $user@$host expect "*assword:*" send "$password\r" interact
chmod +x shellname 使脚本生效
把shell所在路径加入环境变量:http://www.cnblogs.com/vontroy/p/5479889.html
在shell中直接使用shellname即可登录远程服务器