mac item2自动登录服务器 把以下脚本保存,并赋予权限 chmod 755 item2login.sh #!/usr/bin/expect set timeout 30 spawn ssh -p [lindex $argv 0] [lindex $argv 1]@[lindex $argv 2] expect { "(yes/no)?" { send "yes\n";exp_continue} "password:" { send "[lindex $argv