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自己代码仓库里的代码,发现可以正常拉取,问题至此解决
相关推荐
lpfasd12339 分钟前
git-团队协作基础
chrome·git·elasticsearch
John Song3 小时前
git多个账号管理
git·github
CV_J3 小时前
解决Git 冲突后本地提交丢失/未推送问题
git
__Witheart__4 小时前
Git 某个分支恢复到某个特定的 commit 状态
git
破烂pan5 小时前
github精选Agent学习repo
llm·github·agent
XU磊2605 小时前
Git 实现github仓库管理-删除指定目录下的所有文件并保留目录结构
git·github
zhimingwen7 小时前
解决 GitLab Token 轮换后 SourceTree 认证失败问题
git
昵称是6硬币8 小时前
代码管理——VS Code|Git
git·代码管理
Trouville018 小时前
如何在VScode环境下使用git进行版本控制,并上传到gitee远程仓库
ide·git·vscode
weixin_423391939 小时前
从开发到合并:AICR 项目 Git 协作提交全流程指南
git