欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 健康 > 美食 > connect to host github.com port 22: Connection timed out 的解决方法

connect to host github.com port 22: Connection timed out 的解决方法

2025/2/25 2:24:00 来源:https://blog.csdn.net/zapzqc/article/details/144868299  浏览:    关键词:connect to host github.com port 22: Connection timed out 的解决方法

原因是 Github 被 GFW 屏蔽了。

Windows 系统,打开 C:\Windows\System32\drivers\etc,复制其中的 hosts 文件至桌面,用文本编辑器或者其他工具打开。

复制以下内容进去:

140.82.114.4 github.com
151.101.1.6 github.global.ssl.fastly.net
185.199.108.153 assets-cdn.github.com
185.199.109.153 assets-cdn.github.com
185.199.110.153 assets-cdn.github.com
185.199.111.153 assets-cdn.github.com

在这里插入图片描述

保存后,将改文件再复制回去。

在命令行中运行以下内容,来清空 DNS 缓存:

ipconfig /flushdns

一般情况下,问题就会解决。如果发现问题,可通过以下方式更新以上网址对应的 IP 地址。

  1. 打开 https://sites.ipaddress.com/github.com/ 找到 A Records,复制其中的 IP地址,替换空格前面的内容:
140.82.114.4 github.com

在这里插入图片描述

  1. 打开 https://sites.ipaddress.com/fastly.net/ 找到 A Records,复制其中的 IP地址,替换空格前面的内容:
151.101.1.6 github.global.ssl.fastly.net
  1. 打开 https://sites.ipaddress.com/assets-cdn.github.com/ 找到 A Records,复制其中的 IP地址,替换空格前面的内容:
185.199.108.153 assets-cdn.github.com
185.199.109.153 assets-cdn.github.com
185.199.110.153 assets-cdn.github.com
185.199.111.153 assets-cdn.github.com

版权声明:

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

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