【错误】kex_exchange_identification: Connection closed by remote hos

文章目录

    • 错误描述
    • 解决方法

错误描述

git push 的时候出现了下面这个错误

kex_exchange_identification: Connection closed by remote host
Connection closed by 20.205.243.166 port 22
fatal: Could not read from remote repository.

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

翻译过来就是

远程主机关闭的连接
连接关闭20.205.243.166端口22
致命:无法从远程存储库读取。
请确保您拥有正确的访问权限
并且存储库存在。

解决方法

杀死端口 22 的进程
Windows下杀死端口22的进程如下:
1、查找占用端口22的进程

netstat -ano | findstr :22

下面就是查找到端口22的进程,我用红框标注的是PID,因为我本机没有端口22的进程,所以我就暂时用了其他的端口做为示例
在这里插入图片描述
2、杀死进程
后面的[PID]替换成你查询到的PID号即可

taskkill /pid [PID]

之后就解决了

Enumerating objects: 104, done.
Counting objects: 100% (104/104), done.
Delta compression using up to 12 threads
Compressing objects: 100% (43/43), done.
Writing objects: 100% (60/60), 5.20 KiB | 591.00 KiB/s, done.
Total 60 (delta 25), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (25/25), completed with 20 local objects.

你可能感兴趣的:(遇到的错误,git,github,linux)