文章内容

2022/4/24 10:59:17,作 者: 黄兵

腾讯云无法访问 gihub.com 解决方案

昨天(2022年4月23日)本地写好的代码,登录腾讯云服务器拉取,结果如下图所示:

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.

本地提交代码没有问题,但是腾讯云服务器上却无法访问,通过 ping github.com 也是超时。

截图如下:


解决方案:

我使用的是 Ubuntu 系统,直接修改 /etc/hosts 文件,增加如下内容:

修改 /etc/hosts 命令:

sudo vi /etc/hosts

新增如下内容:

140.82.112.3 github.com
199.232.69.194 github.global.ssl.fastly.net

之后保存,不去要重启系统,也不需要做任何操作,直接拉取代码。

这样就可以成功从 gihub.com 拉取代码了,截图如下:


黄兵个人博客原创。

转载请注明出处:黄兵个人博客 - 腾讯云无法访问 gihub.com 解决方案

分享到:

发表评论

评论列表