解决Ubuntu18.04的git clone报错Failed to connect to github.com port 443: Connection refused

这篇具有很好参考价值的文章主要介绍了解决Ubuntu18.04的git clone报错Failed to connect to github.com port 443: Connection refused。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

(只看解决方法的可直接拉到文末!!!)

第一次在ubuntu终端使用git clone,结果报错 Failed to connect to github.com port 443: Connection refused,折腾了半天,终于成功下载(感谢这篇博客解救git clone 时Failed to connect to github.com port 443:connection timed out 怎么办-CSDN博客)

先把终端操作贴下来

解决Ubuntu18.04的git clone报错Failed to connect to github.com port 443: Connection refused,ROS机器人,git,github,ubuntu,机器人

试了好几次都是报错Failed to connect to github.com port 443: Connection refused

解决Ubuntu18.04的git clone报错Failed to connect to github.com port 443: Connection refused,ROS机器人,git,github,ubuntu,机器人

关闭git的SSL证书校验,也可以理解为取消对远程仓库的安全验证。无法解决。

(而且关闭SSL证书校验会降低数据传输的安全性,因此应该尽量避免在安全性较高的环境下使用该命令。同时,在确有需要时,建议使用代理或其他安全措施保证数据传输的安全。)

解决Ubuntu18.04的git clone报错Failed to connect to github.com port 443: Connection refused,ROS机器人,git,github,ubuntu,机器人

网上很多说的都是这个方法:设置全局代理,可能是我的代理地址没设置好,反正是没解决。如果不行,记得取消全局代理

解决Ubuntu18.04的git clone报错Failed to connect to github.com port 443: Connection refused,ROS机器人,git,github,ubuntu,机器人

按照网上说的将https改成git,还是不行

解决Ubuntu18.04的git clone报错Failed to connect to github.com port 443: Connection refused,ROS机器人,git,github,ubuntu,机器人


最终解决办法:修改hosts文件

1)打开https://github.com.ipaddress.com/ 

向下滑找到DNS Resource Records,记住下面的IP地址

解决Ubuntu18.04的git clone报错Failed to connect to github.com port 443: Connection refused,ROS机器人,git,github,ubuntu,机器人

2)打开https://fastly.net.ipaddress.com/github.global.ssl.fastly.net#ipinfo

向下滑找到DNS Resource Records,记住下面的4个地址

解决Ubuntu18.04的git clone报错Failed to connect to github.com port 443: Connection refused,ROS机器人,git,github,ubuntu,机器人

3)打开hosts文件

新开一个终端,输入sudo gedit /etc/hosts,会提示输入用户密码,输入之后就能打开文件

4)修改hosts文件

在hosts文件末尾添加以下内容,然后保存:

140.82.112.3 github.com
151.101.1.6 github.global.ssl.fastly.net
151.101.65.6 github.global.ssl.fastly.net
151.101.129.6 github.global.ssl.fastly.net
151.101.193.6 github.global.ssl.fastly.net

解决Ubuntu18.04的git clone报错Failed to connect to github.com port 443: Connection refused,ROS机器人,git,github,ubuntu,机器人

5)在原先的终端重新输入git clone https://github.com/DroidAITech/ROS-Academy-for-Beginners.git(改为自己的github项目地址)

解决Ubuntu18.04的git clone报错Failed to connect to github.com port 443: Connection refused,ROS机器人,git,github,ubuntu,机器人

成功开始下载!!!文章来源地址https://www.toymoban.com/news/detail-739507.html

到了这里,关于解决Ubuntu18.04的git clone报错Failed to connect to github.com port 443: Connection refused的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包赞助服务器费用

相关文章

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包