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了。

 

posted @ 2016-07-22 17:35  chi++  阅读(2232)  评论(0编辑  收藏  举报