iterm2设置自动登陆

1.做一个auto_ssh.exp

#!/usr/bin/expect

set timeout 30
spawn ssh [lindex $argv 0]@[lindex $argv 1]
expect {
"(yes/no)?"
{send "yes\n";exp_continue}
"password:"
{send "[lindex $argv 2]\n"}
}
interact

2.把脚本拷贝到/usr/local/bin下

3.像图中一样设置

 

ok了。

 

转载于:https://www.cnblogs.com/chiwg/p/5695944.html