iTerm2formac配置克隆会话功能
在mac下重新选择了iTerm2作为了终端工具
发现默认没有类似SecureCRT的clone session功能……

搜索引擎了一下找到了解决方法,整理如下:
〇依次打开Preference -> Profiles -> General -> Working Directory -> 打钩Reuse previous session's directory
〇 编辑mac本地~/.ssh/config文件,添加如下内容,保存退出:
- host *
- ControlMaster auto
- ControlPath ~/.ssh/master-%r@%h:%p
〇 首次登录对应机器,如跳板机等,此时会在~/.ssh目录下生成对应socket文件,形如master-$user@$ip:$port

〇 再次登录,则无需输入密码。
〇为了更加方便,可以添加一个alias。
- echo "alias jump='ssh xxx@192.168.x.x'" >> ~/.bash_profile
- source ~/.bash_profile
p.s. 如果用的是zsh,则添加到~/.zshrc就可以啦
网站标题:iTerm2formac配置克隆会话功能
URL地址:http://jxruijie.cn/article/gccojo.html