iTerm2formac配置克隆会话功能


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


iTerm2 for mac配置克隆会话功能

搜索引擎了一下找到了解决方法,整理如下:

〇依次打开Preference -> Profiles -> General -> Working Directory -> 打钩Reuse previous session's directory


〇 编辑mac本地~/.ssh/config文件,添加如下内容,保存退出:
  1. host *
  2. ControlMaster auto
  3. ControlPath ~/.ssh/master-%r@%h:%p


〇 首次登录对应机器,如跳板机等,此时会在~/.ssh目录下生成对应socket文件,形如master-$user@$ip:$port
iTerm2 for mac配置克隆会话功能


〇 再次登录,则无需输入密码。


〇为了更加方便,可以添加一个alias。
  1. echo "alias jump='ssh xxx@192.168.x.x'" >> ~/.bash_profile
  2. source ~/.bash_profile

p.s. 如果用的是zsh,则添加到~/.zshrc就可以啦





当前文章:iTerm2formac配置克隆会话功能
网页地址:http://lszwz.com/article/gccojo.html

其他资讯

售后响应及时

7×24小时客服热线

数据备份

更安全、更高效、更稳定

价格公道精准

项目经理精准报价不弄虚作假

合作无风险

重合同讲信誉,无效全额退款