iTerm2 配置

Posted on Jul 18, 2023

SSH 远程连接配置

创建登录脚本 /.ssh/remote-login-vps.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

授予执行权限 chmod +x remote-login-vps.sh

进入iTerm2 -> preference -> Profiles,创建一个Profile,在 General - Command - Send text at start 输入~/.ssh/remote-login-vps.sh 22 用户 ip 密码

image (1)