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 端口。

相关推荐
我命由我123457 小时前
Git 推送报错:error: src refspec main does not match any
运维·git·gitee·github·运维开发·学习方法·版本控制
阿里嘎多学长8 小时前
2026-09-20 GitHub 热点项目精选
开发语言·程序员·github·代码托管
峰向AI9 小时前
skill-up: [阿里开源] 让 AI Agent Skills 自己进化的评估工具
github
子林super12 小时前
顺序表用Python3定义与增删改查
github
子林super12 小时前
Python非空判断与类型检查写法
github
子林super12 小时前
Python list与array关键区别及使用场景
github
子林super12 小时前
Python中None与null的区别
github
u13013015 小时前
GitHub 热榜项目:周榜(2026-09-20)
人工智能·github
u13013016 小时前
GitHub 热榜项目:日榜(2026-09-20)
人工智能·github
逛逛GitHub16 小时前
外网 3500 万人围观的 Jev 模型,有这 10 个神奇玩法。
github