macOS 的ssh-add -K

macOS 10.12 开始ssh-add并不是默认将你的ssh-key添加进去了,所以需要额外配置一下

打开自己的ssh配置文件~/.ssh/config,加入如下内容

Host *
    UserKnownHostsFile /dev/null #这一句还好吧
    StrictHostKeyChecking no #这一句非常危险,结合上一句再加上dns劫持的话,再加上密码认证就很有泄漏密码的可能性
    ForwardAgent yes
    TCPKeepAlive yes
    IdentityFile ~/.ssh/id_rsa
    AddKeysToAgent yes

One thought on “macOS 的ssh-add -K”

Leave a Reply

Your email address will not be published. Required fields are marked *