解决华为云服务器无法ping通github问题

在push代码到github上的时候,发现显示22端口无法连接,在已经开放了端口,防火墙关闭的情况下仍然无法连接到GitHub。

发现是服务器和github断连,选择

复制代码
sudo vim /etc/hosts

添加一下代码

复制代码
  # GitHub Start
    140.82.121.4      github.com
    140.82.121.3      gist.github.com
    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
    185.199.108.133   avatars0.githubusercontent.com
    185.199.109.133   avatars1.githubusercontent.com
    185.199.110.133   avatars2.githubusercontent.com
    185.199.111.133   avatars3.githubusercontent.com
    # GitHub End

再次ping发现ping通

这种情况最常见的原因是你的服务器与 GitHub 服务器之间的网络路径受到了干扰或屏蔽,这通常与防火长城 (GFW) 有关。GFW 可能会对特定的 IP 地址段进行封锁或使其连接质量极差。

相关推荐
Up九五小庞1 小时前
jenkins从入门到精通-P1—九五小庞
运维·jenkins
ALLSectorSorft2 小时前
相亲小程序用户注册与登录系统模块搭建
java·大数据·服务器·数据库·python
乐维_lwops2 小时前
运维端口管理闭环:从暴露面测绘到自动化封禁!
运维·自动化·php
Cyber4K2 小时前
MySQL--组从复制的详解及功能演练
运维·数据库·mysql·云原生
hzsnone3 小时前
公网服务器上Nginx或者Openresty如何屏蔽IP直接扫描
服务器·nginx·openresty
wyjcxyyy3 小时前
打靶日记-RCE-labs(续)
linux·运维·服务器
光军oi4 小时前
Javaweb————Apache Tomcat服务器介绍及Windows,Linux,MAC三种系统搭建Apache Tomcat
服务器·tomcat·apache
南林yan4 小时前
仿muduo库实现高并发服务器
服务器
六点半8884 小时前
【Linux】Linux编译器-gcc/g++使用
linux·运维·服务器
我才是一卓4 小时前
排查解决 nvidia-suspend 导致的 linux 系统无响应/死机问题
linux·运维·服务器