首先创建一个expect脚本ssh_expect,文件内容如下: #!/usr/bin/expect -f set hostname [lindex $argv 0] set user [lindex $argv 1] set passwd [lindex $argv 2] set timeout 30 set force_conservative 1 if {$force_conservative} { set send_slow {128 .1} } spawn ssh $user@$hos…