【工具使用】WebStorm 连接github 出现 invalid host key ssh-rsa 问题的解决

本地git配置远程ssh连接github仓库

无法提交报Push failed
Invald host key ssh-rsa 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48
java.io.IOException: There was a problem while connecting to github.com:22
at com.trilead.ssh2.Connection.connect(Connection.java:834)
at com.trilead.ssh2.Connection.connect(Connection.java:703)
at com.trilead.ssh2.Connection.connect(Connection.java:617)
at org.jetbrains.git4idea.ssh.SSHMain.start(SSHMain.java:160)
at org.jetbrains.git4idea.ssh.SSHMain.main(SSHMain.java:124)
Caused by: java.io.IOException: Key exchange was not finished, connection is closed.
at com.trilead.ssh2.transport.KexManager.getOrWaitForConnectionInfo(KexManager.java:95)
at com.trilead.ssh2.transport.TransportManager.getConnectionInfo(TransportManager.java:237)
at com.trilead.ssh2.Connection.connect(Connection.java:786)
… 4 more
Caused by: java.io.IOException: The server hostkey was not accepted by the verifier callback
at com.trilead.ssh2.transport.KexManager.handleMessage(KexManager.java:548)
at com.trilead.ssh2.transport.TransportManage… (show balloon)错误

1. 为git添加环境变量

【工具使用】WebStorm 连接github 出现 invalid host key ssh-rsa 问题的解决

2.1 配置本地./ssh文件

​ 参见:https://zhidao.baidu.com/question/1303468264429394659.html回答;

​ 2.2 在 安装的 id_rsa.pub文档中,用记事本打开,复制文本到github添加sshkeys

【工具使用】WebStorm 连接github 出现 invalid host key ssh-rsa 问题的解决

【工具使用】WebStorm 连接github 出现 invalid host key ssh-rsa 问题的解决

​ 添加后发现./ssh文件中多了know_hosts文件,说明配置成功

接下来就可以开心地用git

add-commit 本地仓库 和push,pull github上的项目啦

【工具使用】WebStorm 连接github 出现 invalid host key ssh-rsa 问题的解决