Permission denied (publickey)的解决办法
在添加完Coding.net的ssh-key以后,执行ssh -T [email protected]
时,会出现如下错误:
1 | Warning: Permanently added the RSA host key for IP address '106.75.4.187' to the list of known hosts. |
这个错误在之前添加gitee时也遇到过,当时忘记怎么处理了,翻了下history,发现执行如下命令即可解决:
1 | ssh-add ~/.ssh/id_rsa.coding |
id_rsa.coding
是你生成ssh-key时指定的名称,例如本文生成ssh-key的命令为:
1 | ssh-keygen -t rsa -f ~/.ssh/id_rsa.coding -C "Coding" |
接着在~/.ssh/config
中加入如下配置:
1 | Host coding.net |
此时再执行ssh -T [email protected]
命令就可以通过了
1 | ssh -T [email protected] |
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.
Comment