当前位置:   article > 正文

ssh: connect to host github.com port 22: Connection timed out fatal: Could not read from remote……_github打不开

github打不开

报错

> git pull --tags origin main
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

分析

登录了一下github网站,发现可以访问:
在这里插入图片描述

但是,ping了一下github,发现请求超时。

在这里插入图片描述

git、命令行都无法正确解析域名,但浏览器可以,有些奇怪。

但可以判断,确实是网络域名解析出现了问题,下面将采用手动修改hosts文件的方式解决。

解决

  1. 打开网站:https://www.ipaddress.com/ip-lookup,并在红框中输入域名,查询域名对应的IP地址;
    在这里插入图片描述
  2. 点击lookup;
  3. 得到对应区域的github主机名;
    在这里插入图片描述
  4. 查询如下两个主机名:
140.82.113.3 github.com
146.75.77.194 github.global.ssl.fastly.net
  • 1
  • 2
  1. 补充到C:\Windows\System32\drivers\etc\hosts文件的末尾,该文件不可编辑,可以复制到桌面,然后再复制回去实现替换。
    在这里插入图片描述
  2. 测试:
    在这里插入图片描述
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/article/detail/46151?site
推荐阅读
相关标签
  

闽ICP备14008679号