在mac下重新选择了iTerm2作为了终端工具
发现默认没有类似SecureCRT的clone session功能……
![](http://img.blog.itpub.net/blog/attachment/201708/18/29773961_1503002626XCl8.png?x-oss-process=style/bb)
搜索引擎了一下找到了解决方法,整理如下:
〇 依次打开 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
![](http://img.blog.itpub.net/blog/attachment/201708/18/29773961_15030033953d22.png?x-oss-process=style/bb)
〇 再次登录,则无需输入密码。
〇 为了更加方便,可以添加一个alias。
- echo "alias jump='ssh xxx@192.168.x.x'" >> ~/.bash_profile
- source ~/.bash_profile
p.s. 如果用的是zsh,则添加到 ~/.zshrc就可以啦
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29773961/viewspace-2143751/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/29773961/viewspace-2143751/