mac下iterm2配置安装,通过expact实现保存账号,及通过跳板登陆配置

时间:2023-03-09 17:13:12
mac下iterm2配置安装,通过expact实现保存账号,及通过跳板登陆配置

在参考了几款mac不错的ssh工具外,最终选择使用iterm2。本来打算用FinalShell,安装后发现其icon在访达中根本不现实,而且每次访问还需要输入管理员账号密码,强迫症根本受不了...

  • 官网下载

https://www.iterm2.com/downloads.html

  • 安装

双击.app即可

  • 配置

有趣的在于后面的配置

采用expact脚本方式来完成对远程登陆的账号密码配置来进行配置

profiles-open profiles

mac下iterm2配置安装,通过expact实现保存账号,及通过跳板登陆配置

选择Login shell

Send text at start 填写  /Users/whk/dev/defaultlogin.sh 22 root 服务器IP 密码

mac下iterm2配置安装,通过expact实现保存账号,及通过跳板登陆配置

/Users/whk/dev/defaultlogin.sh 文件如下:

#!/usr/bin/expect

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

普通登陆参考