Mac自动ssh登录,一般都是采用免密码登录,当某种管理下不能使用免密码登录时,这种自动登录就非常重要了。
主要涉及两个东西:
- 自动登录 https://github.com/flying5/ssh-auto-login-manage
- ssh的session保持(这个可以不使用,个人觉得有session后打开原来的ip会非常快)
第一个按照说明就配置起来。
第二个也比较简单在
~/.ssh/config # 如果没这个文件,新建一个
在config文件里面填入
host *
ControlMaster auto
ControlPath ~/.ssh/master-%r@%h:%p
搞定。非常实用!