#!/usr/bin/expect
set user [lindex $argv 0]
set ipaddress [lindex $argv 0]
set passwd [lindex $argv 1]
spawn ssh $user@$ipaddress
expect {
"yes/no" { send "yes\r";exp_continue }
"password:" { send "$passwd\r" }
}
interact
转载请注明原文地址: https://ju.6miu.com/read-25474.html