首页 > 解决方案 > 尝试连接到 git 上的远程存储库时出现“ssh_exchange_identification: read: Connection reset by peer”错误

问题描述

我对 github 很陌生,大约两周前我开始使用它。一切都很完美,我能够从远程存储库中推送和拉取。然而,今天,当我试图从中拉出时,我收到了以下错误消息:

ssh_exchange_identification: read: Connection reset by peer
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

事实上,当我尝试做任何连接到我的远程 github 存储库的事情(推送、拉取、获取等)时,它会给我同样的错误。

当我输入这个命令时:“ssh -T git@github.com”,我得到:

ssh_exchange_identification: read: Connection reset by peer

我没有修改我的存储库或我的 SSH 密钥或任何东西中的任何设置,所以我不知道它为什么突然停止工作。可能是什么问题呢?

标签: gitgithub

解决方案


我最近遇到了类似的问题,我不确定它是否与我通过以下命令获得连接的用户完全相同。

ssh -T git@gitlab.com

但是当我尝试将代码推送到远程存储库时,我得到了同样的错误。

kex_exchange_identification: read: Connection reset by peer
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

在尝试了互联网上的几个解决方案但没有成功后,我只是尝试了一下git init它对我有用。我希望这仅在连接用户已正确绑定时才有效。

试试看 祝你好运.. :)


推荐阅读