背景
git push 代码报错
ssh_exchange_identification: Connection closed by remote host
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
解决办法:
- 确认是否在git仓库上注册 ssh 公钥
- 有可能是网络问题
怎么检查是否网络问题?
ssh git@git.XXX.com -vT
出现ssh_exchange_identification: read: Connection reset by peer 就是网络问题
此时 ping 仓库地址, 可能是通的,但还是有问题

如果输出如图所示,此时网络OK, 可以push了

本文介绍了解决使用Git推送代码时遇到的ssh_exchange_identification: Connection closed by remote host错误的方法。主要涉及确认SSH公钥是否已注册及如何排查网络问题。
1187

被折叠的 条评论
为什么被折叠?



