解决 ssh: connect to host github.com port 22: Connection timed out

用git 拉取代码时, 偶尔会出现下面的错误:

bash 复制代码
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.

出现这个错误的原因是 22 端口被防火墙屏蔽了, 换一个端口即可,如443端口。

操作方法:

bash 复制代码
 vim ~/.ssh/config

添加如下内容:

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

参考链接: https://zhuanlan.zhihu.com/p/521340971

相关推荐
guiyanakaung3 小时前
CMP 如何优雅的实现跨软件的拖拽功能
前端·github
jarreyer6 小时前
【语义分割】记录2:yolo系列
大数据·yolo·elasticsearch
HelloGitHub6 小时前
开源新旗舰 GLM-4.5:不想刷榜,只想干活儿
人工智能·开源·github
星际码仔7 小时前
Zread 和 DeepWiki 怎么选?一张图全搞懂
github·chatglm (智谱)
DogDaoDao8 小时前
GitHub开源项目Zerox:AI驱动的OCR革命
人工智能·深度学习·开源·github·ocr·图像识别·zerox
Albert_Lsk8 小时前
【2025/07/28】GitHub 今日热门项目
人工智能·开源·github·开源协议
唐青枫9 小时前
Linux sshfs 安全挂载远程文件系统 命令详解
linux·ssh
C++ 老炮儿的技术栈20 小时前
在 Scintilla 中为 Squirrel 语言设置语法解析器的方法
linux·运维·c++·git·ubuntu·github·visual studio
油泼辣子多加20 小时前
2025年07月25日Github流行趋势
github
OpenTiny社区21 小时前
把 SearchBox 塞进项目,搜索转化率怒涨 400%?
前端·vue.js·github