【解决方法】git pull报错ssh: connect to host github.com port 22: Connection timed out

问题

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

解决方法

在C:\Users\username.ssh文件夹下新建config文件,填入以下文本(如有则直接在文件最后一行新增):

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

将22端口修改为443即可。

验证:

复制代码
ssh -T [email protected]

出现Hi xxxx! You've successfully authenticated, but GitHub does not provide shell access.即正常。

参考资料

https://zhuanlan.zhihu.com/p/521340971

相关推荐
独立开阀者_FwtCoder1 小时前
Cursor 1.0 重磅发来袭(毛骨悚然,开始学习你如何编码)
前端·javascript·github
几道之旅1 小时前
gitcode与github加速计划
github·gitcode
Clownseven3 小时前
SSH/RDP无法远程连接?腾讯云CVM及通用服务器连接失败原因与超全排查指南
服务器·ssh·腾讯云
ricky_fan3 小时前
window下配置ssh免密登录服务器
运维·服务器·ssh
WindrunnerMax4 小时前
从零实现富文本编辑器#5-编辑器选区模型的状态结构表达
前端·架构·github
自来也_5 小时前
Git配置代理
git
寻月隐君5 小时前
探索Web3新速度:Sonic高性能Layer-1上的BlindAuction智能合约实践
后端·web3·github
油泼辣子多加5 小时前
2025年06月07日Github流行趋势
github
Moment6 小时前
给大家推荐一个超好用的 Marsview 低代码平台 🤩🤩🤩
前端·javascript·github
独立开阀者_FwtCoder7 小时前
stagewise:让AI与代码编辑器无缝连接
前端·javascript·github