#!/usr/bin/expect
set user "userB"
set passwd "12345678"
spawn ssh $user@B
expect{
"yes/no" {send "yes\r";exp_continue}
"password:" {send "$passwd\r"}
}
expect "]"
send "/bin/bash ~/testsh\r"
expect "]"
send "exit\r"
欢迎分享,转载请注明来源:内存溢出
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)