expect实现自动登录

#!/usr/bin/expect
set password "你的密码"
spawn ssh -qTfnN -D 7070 tiandsp@216.194.70.6
expect "tiandsp@216.194.70.6's password:"
send "$password\r"
expect "*$"
send "exit\r"
posted @ 2012-07-22 11:38  Dsp Tian  阅读(444)  评论(0编辑  收藏  举报