exp
时间:2006-05-29 来源:very_99
spawn ssh -t root@$argv
expect {
"* (yes/no)*" { send "yes\r" ; set sshkey 1}
"* password:*" { send "123456\r" }}
if $sshkey!=1 {expect "* password:*"
send "123456\r" }
expect {
"* (yes/no)*" { send "yes\r" ; set sshkey 1}
"* password:*" { send "123456\r" }}
if $sshkey!=1 {expect "* password:*"
send "123456\r" }
相关阅读 更多 +