iterm设置session管理

Jun 17, 2020

1、建立文件 sshconfig.sh 。内容如下

!/usr/bin/expect

set timeout 30
spawn ssh -p [lindex $argv 0] [lindex $argv 1]@[lindex $argv 2]
expect {
“(yes/no)?”
{send “yes\n”;exp_continue}
“password:”
{send “[lindex $argv 3]\n”}
}
interact

2、打开iterm设置。

其中command命令为

location/sshconfig.sh 22 user 192.xxx.xxx.245 pwd

[sshconfig.sh文件绝对路径] [端口号] [用户名] [服务器ip] [密码]

3、iterm自动连接

标签