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

相关推荐
一张假钞5 小时前
Ubuntu SSH 免密码登陆
linux·ubuntu·ssh
失散139 小时前
分布式专题——47 ElasticSearch搜索相关性详解
java·分布式·elasticsearch·架构
水电费嘎嘎9 小时前
Claude Code接入Github
github·claude code
Swift社区10 小时前
LeetCode 401 - 二进制手表
算法·leetcode·ssh
默默coding的程序猿10 小时前
3.git的分支携带问题是什么?怎么解决?
java·git·python·svn·gitee·github·intellij-idea
ITKEY_11 小时前
ssh中neovim无法复制文本 clipboard
运维·ssh
铭毅天下12 小时前
Elasticsearch 到 Easysearch 数据迁移 5 种方案选型实战总结
大数据·elasticsearch·搜索引擎·全文检索
Elastic 中国社区官方博客15 小时前
Elasticsearch 推理 API 增加了开放的可定制服务
大数据·数据库·人工智能·elasticsearch·搜索引擎·ai·全文检索
oneslide16 小时前
openssh10.0p1 源码构建安装 & rpm安装包构建
ssh
yumgpkpm18 小时前
华为鲲鹏 Aarch64 环境下多 Oracle 数据库汇聚操作指南 CMP(类 Cloudera CDP 7.3)
大数据·hive·hadoop·elasticsearch·zookeeper·big data·cloudera