解决腾讯云轻量服务器国内机器无法使用Github

解决腾讯云轻量服务器国内机器无法使用Github

报错如下:

[root@VM-4-7-centos leshared.com]# git push -u origin master
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.

解决思路:修改Host

https://www.ipaddress.com/

利用上面的网站查询github.com和raw.githubusercontent.com的DNS解析的IP地址

最后,修改服务器的/etc/hosts
添加如下两行:

140.82.112.4 github.com
185.199.108.133 raw.githubusercontent.com

这是最新的IP地址,如果更改之后还无法git clone的话,可能IP地址又更新了,需要查询一下最新的地址
转自:https://blog.csdn.net/weixin_43456810/article/details/118064178

© 版权声明
THE END
喜欢就支持一下吧
点赞0赞赏 分享
评论 共1条

请登录后发表评论

    请登录后查看评论内容