mac iterm2 保存账号密码 登录

 

1.新建文件 : touch iterm2login.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.进入目录执行命令:chmod +x iterm2login.exp  

4.iterm2 中,【command + ,】    进入设置即可

 

 

 

 

 

 

posted @ 2019-01-11 14:15  Proli  阅读(3060)  评论(0编辑  收藏  举报