您的位置:首页 > 教育 > 培训 > 【Git】win本地 git bash:Connect reset by 20.205.243.166 port22报错问题解决

【Git】win本地 git bash:Connect reset by 20.205.243.166 port22报错问题解决

2025/5/25 20:26:38 来源:https://blog.csdn.net/m0_63628018/article/details/139741972  浏览:    关键词:【Git】win本地 git bash:Connect reset by 20.205.243.166 port22报错问题解决

win10 git bash 控制台 reset 22端口拒绝连接问题:

Connection reset by 20.205.243.166 port 22

1、22端口 无法连接

ssh -T git@github.com

2、尝试用443端口 仍然无法连接

ssh -T -P 443 git@github.com

3、重写 git clone 地址 url,全局添加 https 前缀,仍然无法连接

git config --global url."https://".insteadOf git://

4、在 C:/Users/username/.ssh/ 下创建 config 文件

C:/Users/username/.ssh/config 文件内容:

Host github.com port 22       User git       HostName github.com       PreferredAuthentications publickey       IdentityFile ~/.ssh/id_rsa   # 端口号修改为自己的端口号ProxyCommand connect -S 127.0.0.1:7890 -a none %h %p

仍无法连接

5、使用 clashforwindows 提供的 7890 端口,并且 关闭 混合随机分配端口

 

6、

ssh -T git@github.com

根据引导重新生产 id_rsa 和 id_rsa.pub,将 id_rsa.pub 重新放入 github -> settings -> ssh and gpg keys -> new ssh key 即可,git@github.com 
连接成功,git clone git@github.com:账户名/.git 可以使用

参考:

How to fix "ssh: connect to host github.com port 22: Connection timed out" for git push/pull/... commands? - Stack Overflow

【Git】Connect reset by 20.205.243.166 port22报错问题解决_connection reset by 20.205.243.166 port 22-CSDN博客

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com