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

相关推荐
玄同7654 小时前
Git常用命令指南
大数据·git·elasticsearch·gitee·github·团队开发·远程工作
吠品5 小时前
命令行揭示SSL证书真相
https·github·ssl
、BeYourself5 小时前
解决git@github.com: Permission denied (publickey)
github
十步杀一人_千里不留行7 小时前
Git提交前ESLint校验实践(Husky + lint-staged)
git·github
朱昆鹏7 小时前
开源 Claude Code + Codex + 面板 的未来vibecoding平台
前端·后端·github
猫头虎9 小时前
OpenClaw-VSCode:在 VS Code 里玩转 OpenClaw,远程管理+SSH 双剑合璧
ide·vscode·开源·ssh·github·aigc·ai编程
你听得到1111 小时前
我彻底搞懂了 SSE,原来流式响应效果还能这么玩的?(附 JS/Dart 双端实战)
前端·面试·github
宁雨桥11 小时前
Gitee迁移GitHub开源全攻略:一键配置自动同步,仅需维护单一仓库
gitee·开源·github
掘金安东尼11 小时前
⏰前端周刊第 452 期(2026年2月2日-2月8日)
前端·javascript·github
CoderJia程序员甲11 小时前
GitHub 热榜项目 - 日榜(2026-02-08)
git·ai·开源·llm·github