创建一个登录脚本
#!/usr/bin/expect
set timeout 10
spawn ssh [lindex $argv 0]@[lindex $argv 1]
expect {
"(yes/no)?"
{send "yes\n";exp_continue}
"password:"
{send "[lindex $argv 2]\n"}
}
interact
给脚本赋予执行权限
chmod +x *.sh
在iTerm2中配置