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自己代码仓库里的代码,发现可以正常拉取,问题至此解决
相关推荐
王老邪6 小时前
Windows下利用PowerShell实现Git自动推送
windows·git
极客先躯7 小时前
如何自动提取Git指定时间段的修改文件?Win/Linux双平台解决方案
linux·git·elasticsearch
小邓的技术笔记7 小时前
Git 中模糊搜索分支名称并创建本地跟踪分支
git
CoderJia程序员甲8 小时前
GitHub 热榜项目 - 日榜(2026-1-13)
人工智能·ai·大模型·github·ai教程
A half moon11 小时前
【从开发到上线-全栈开发教程】Git上传本地项目到仓库
git
iuu_star12 小时前
项目开源-零基础掌握GitHub大文件上传(Git)
开源·github
wangruofeng12 小时前
OpenCode 上手初体验:从安装到基础使用
github·ai编程
三水吉吉12 小时前
git commit 后,取消其中一个文件的提交
git
Albert Edison13 小时前
【Git】多人协作二(不同分支下)
git·elasticsearch·svn·github
C+++Python15 小时前
如何使用 VS Code 进行 Git 管理?
git