#!/usr/bin/expect
set user [ lindex $argv 0 ] #用户名
set ip [ lindex $argv 1 ]
#访问ip
set passwd [ lindex $argv 2 ] #用户密码
spawn ssh $user@$ip
expect {
"password:" { send "$passwd\r"; exp_continue }
}
interact
~
转载请注明原文地址: https://ju.6miu.com/read-17018.html