- ITerm2下載:
鏈接: https://pan.baidu.com/s/15GlJYihUuPGnebESjC-jKQ 提取碼: 5wwg - 下載后解壓將ITerm2放到應用程序目錄下,運行ITerm2,執行命令
cd ~/.ssh/ touch banwagong
vim banwagong - 將如下腳本粘貼到文本banwagong
#!/usr/bin/expect -f set user 用戶名 set host IP/域名 set port 端口號 set password 密碼 set timeout -1 spawn ssh $user@$host -p $port expect "*assword:*" send "$password\r" interact expect eof
- ITerm2界面快捷鍵command+o;

1、 點擊新建
2、給當前名字命名
3、選擇command
4、expect ~/.ssh/banwagong
