github: kex_exchange_identification: Connection closed by remote host

问题描述

bash 复制代码
(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文件
bash 复制代码
(base) ➜  .ssh vi ~/.ssh/config
  • 添加下述配置
bash 复制代码
Host github.com
    Hostname ssh.github.com
    Port 443
    User git
  • 结果如下图
  • 运行如下代码进行验证
bash 复制代码
$ ssh -T git@github.com
> Hi USERNAME! You've successfully authenticated, but GitHub does not
> provide shell access.
  • 如果都没问题,重新git pull自己代码仓库里的代码,发现可以正常拉取,问题至此解决
相关推荐
Zach_yuan1 小时前
版本控制器Git
linux·git
爱宇阳4 小时前
Linux 教程:如何查看服务器当前目录中的文件
linux·运维·github
CoderJia程序员甲5 小时前
GitHub 热榜项目 - 日榜(2025-10-17)
ai·llm·github·开源项目·github热榜
绝无仅有5 小时前
面试真实经历某商银行大厂数据库MYSQL问题和答案总结(一)
后端·面试·github
绝无仅有5 小时前
Docker 实战经验之关键文件误删恢复指南
后端·面试·github
Sirens.6 小时前
Java核心概念:抽象类、接口、Object类深度剖析
java·开发语言·github
唐青枫6 小时前
Git 提交时神秘的 create mode 100644 到底是什么?一文告诉你答案!
git
春生野草6 小时前
Git-git stash与分支管理
git
ljh5746491196 小时前
Git合并冲突解决方法
git
悟能不能悟6 小时前
git revert commit和undo commit的区别
git