解决 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

相关推荐
Elastic 中国社区官方博客10 小时前
Elastic 和 AWS 合作将 GenAI 引入 DevOps、安全和搜索领域
大数据·数据库·elasticsearch·搜索引擎·云计算·全文检索·aws
L2ncE14 小时前
ES101系列08 | 数据建模和索引重建
java·后端·elasticsearch
CC_IsMe15 小时前
Linux服务器 TensorFlow找不到GPU
linux·jupyter·ssh·conda·tensorflow
struggleupwards16 小时前
耗费三个月,开发了一款博客
开源·github·全栈
寻月隐君1 天前
用 Rust 打造命令行利器:从零到一实现 mini-grep
后端·rust·github
中间件XL1 天前
搜索引擎2.0(based elasticsearch6.8)设计与实现细节(完整版)
大数据·elasticsearch·搜索引擎
m0_555762901 天前
GitLab CI、GitHub Actions和Jenkins进行比较
ci/cd·gitlab·github
livemetee1 天前
一个完整的日志收集方案:Elasticsearch + Logstash + Kibana+Filebeat (一)
大数据·elasticsearch·搜索引擎
油泼辣子多加1 天前
2025年05月30日Github流行趋势
github
小和尚同志1 天前
3. Github Actions 自动部署
程序员·开源·github