1.配置Profiles
#!/usr/bin/expect -f
set user <用户名>
set host <ip地址>
set password <密码>
set timeout -1
spawn ssh $user@$host -p 22
expect "*assword:*"
send "$password\r"
interact
expect eof
配置完毕后放在具体某处,命名如根据服务器名称命名103
2.iTerm2中配置Profiles
其中Command:expect <Profile存放地址>

3.iTerm2中菜单直接打开

网友评论