GitHub 异常 - 无法连接22端口 Connection timed out

GitHub 异常 - 无法连接22端口 Connection timed out

问题描述

错误信息:

今天突然用ssh方式 pull GitHub的项目报:ssh: connect to host xx.xx.xx.xx port 22: Connection timed out

表明 SSH 连接在尝试通过 22 端口连接到远程服务器时超时。这可能是由于网络环境、防火墙设置或代理配置等原因导致的(很可能端口22被防火墙或提供商阻止了)。

GitHub允许使用443端口

为了解决此问题,我们可以尝试将 SSH 连接切换到 443 端口。

~/.ssh/config 文件中添加以下内容:

bash 复制代码
Host github.com
  Hostname ssh.github.com
  Port 443

这将使你的 SSH 连接通过 443 端口与 ssh.github.com 进行通信,而不是默认的 22 端口。

相关推荐
2201_761199041 天前
jenkins找不到Build when a change is pushed to GitHub
运维·github·jenkins
此生只爱蛋1 天前
【Linux】内网穿透(实操)/打洞
linux·github
恋恋西风1 天前
github 类似 开源网站
github·源代码管理·开源网站
无限进步_1 天前
【C语言&数据结构】有效的括号:栈数据结构的经典应用
c语言·开发语言·数据结构·c++·git·github·visual studio
love530love1 天前
Win11+RTX3090 亲测 · ComfyUI Hunyuan3D 全程实录 ②:nvdiffrast 源码编译实战(CUDA 13.1 零降级)
人工智能·windows·python·github·nvdiffrast
sunflower_level21 天前
【ssh key】登陆云服务器,github的安全密码
服务器·ssh·github
CoderJia程序员甲1 天前
GitHub 热榜项目 - 日榜(2025-12-20)
git·ai·开源·llm·github
GoGeekBaird2 天前
分享几个使用Nano Banana Pro 画信息图的提示词
后端·github
UVM_ERROR2 天前
RDMA Scheduler + TX + Completion RTL 开发经验分享
笔记·vscode·ssh·github·芯片