github配置ssh的时候 ssh: connect to host github.com port 22: Connection timed out

今天配置ssh的时候最后一步验证是否能够连接成功的时候,出现了这个报错

查看了一下 .ssh 文件夹,发现只有两个文件

但是看到网上别人的都是有一个config文件,所以我们也要创建一个config文件(这个文件是没有文件类型的)

里面填入

复制代码
Host github.com
HostName ssh.github.com  # 这是最重要的部分
User git
Port 443
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa

然后运行 ssh -T git@github.com

然后就可以啦,并且ssh文件夹里面还多了几个文件

相关推荐
IMPYLH3 小时前
Linux 的 pinky 命令
linux·运维·服务器·bash
shandianchengzi4 小时前
【记录】Copilot|Github Copilot重新学生认证通过方法(2025年7月,包括2FA和认证材料、Why are you not on campus)
github·copilot
K1ne_4 小时前
2026 最新版|学生认证白嫖 GitHub Copilot Pro 保姆级教程
github·copilot
cs.shunzhang4 小时前
GitHub 教育认证通过后如何领取 Copilot Pro
github·copilot
程序员柒叔4 小时前
OpenCode 踩坑记:GitHub Copilot 按次计费?我的账单为何暴涨 3 倍!
github·copilot·claude code·opencode
刚刚觉醒的小菜鸡4 小时前
copilot学生认证2026-github copilot学生认证(手把手教会)
github·copilot
HelloWorld_SDK4 小时前
Docker安装OpenClaw
运维·docker·容器·openclaw
徐小夕4 小时前
我花一天时间Vibe Coding的开源AI工具,一键检测你的电脑能跑哪些AI大模型
前端·javascript·github
REDcker4 小时前
Linux iptables 与 Netfilter:原理、路径与运维要点
linux·运维·服务器
KKKlucifer6 小时前
零信任融合实践:国内堡垒机如何落地动态权限与实时阻断
运维