http://blog.csdn.net/wandershi/article/details/75088310
1.创建Profiles文件
cd ~/.ssh/iTerm2SSH/ vi 172.16.1.1 #!/usr/bin/expect spawn ssh [email protected]172.16.1.1 expect "*password:" send "123\r" expect "*#" interact
2.添加配置文件到iTerm2
iTerm2->Preferences->profile->
name: 172.16.1.1
Command->expect /Users/wangzhongkui/.ssh/iTermSSH/172.16.1.1
3.Profiles->172.16.1.1