分类目录

链接

2023 年 10 月
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

近期文章

热门标签

新人福利,免费薅羊毛

现在位置:    首页 > Others > 正文
github连接超时:Connection closed by remote host
Others 暂无评论 阅读(83)

git pull 或者git push的时候,提示:

kex_exchange_identification: Connection closed by remote host
Connection closed by 127.0.0.1 port 22
fatal: Could not read from remote repository.

Please make sure you have the correct access rights

 

使用命令:ssh -T git@github.com 检测

如果测试成功,请关闭代理试试,如果测试失败,请向下配置:

ssh的22端口改为使用443

在等待git pull命令超时之后报出了类似: ssh: connect to host github.com port 22: Connection timed out的错误!

原因是: ssh 阻塞了22端口!

解决方法: 修改 ssh 的配置文件

关于修改配置,存在两种解决方法:

/etc/ssh/ssh_config 中修改全局配置
在用户主目录下.ssh/中添加配置文件
这里选择的后者:

cd ~/.ssh/
vi config

# 在config中添加下面内容

Host github.com
User git
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 443

 

即: 使用https的443端口进行访问!

============ 欢迎各位老板打赏~ ===========

本文版权归Bruce's Blog所有,转载引用请完整注明以下信息:
本文作者:Bruce
本文地址:github连接超时:Connection closed by remote host | Bruce's Blog

发表评论

留言无头像?