github: kex_exchange_identification: Connection closed by remote host

问题描述

(base)test git:(dev) git pull
kex_exchange_identification: Connection closed by remote host
Connection closed by 192.30.255.113 port 22
致命错误:无法读取远程仓库。

解决方案

参照下边文档
https://docs.github.com/en/authentication/troubleshooting-ssh/using-ssh-over-the-https-port

  • 进入config文件
(base) ➜  .ssh vi ~/.ssh/config
  • 添加下述配置
Host github.com
    Hostname ssh.github.com
    Port 443
    User git
  • 结果如下图
    github: kex_exchange_identification: Connection closed by remote host_第1张图片
  • 运行如下代码进行验证
$ ssh -T [email protected]
> Hi USERNAME! You've successfully authenticated, but GitHub does not
> provide shell access.
  • 如果都没问题,重新git pull自己代码仓库里的代码,发现可以正常拉取,问题至此解决

你可能感兴趣的:(Git,github,git)