使用代理连接Github异常

1. 问题表象

将自己本机的~/.ssh/id_ed25519.pub公钥配置到Github中的SSH and GPG keys之后,在本机命令行执行ssh -T git@github.com提示输入密码而非输出Hi github用户名! You've successfully authenticated, but GitHub does not provide shell access.,得出结论->ssh连接异常

2. 排查过程

  • 执行ssh -vT git@github.com开启debug模式分析连接github的ssh输出日志
bash 复制代码
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: keyboard-interactive

发现本机私钥在连接中被拒绝->怀疑代理问题->尝试3.解决方案后连接成功

3. 解决方案

  • 使用代理连接github,22端口流量容易被代理劫持污染,执行vim ~/.ssh/config将如下配置,写入~/.ssh/config文件,强制ssh连接ssh.github.com:443
bash 复制代码
Host github.com
  HostName ssh.github.com
  Port 443
  User git
  IdentityFile ~/.ssh/id_ed25519
  AddKeysToAgent yes
  UseKeychain yes
  • 执行ssh -T git@github.com测试ssh是否成功连接
相关推荐
CoderJia程序员甲17 小时前
GitHub 热榜项目 - 日榜(2026-04-20)
ai·大模型·llm·github·ai教程
Java后端的Ai之路17 小时前
SSH配置与GitHub项目拉取操作指南
elasticsearch·ssh·github·公钥
纪伊路上盛名在17 小时前
如何跨设备访问我们VSCode中GitHub Copilot 的聊天记录?
vscode·github·copilot·工作流
第一程序员1 天前
数据工程 pipelines 实践
python·github
CV工程师(Ctrl)1 天前
OpenClaw 安装与飞书接入(2026-04-19)
node.js·github·飞书·火山引擎·openclaw
历程里程碑1 天前
2. Git版本回退全攻略:轻松掌握代码时光机
大数据·c++·git·elasticsearch·搜索引擎·github·全文检索
darkb1rd1 天前
lingbot-map:流式 3D 重建实战指南与解析
开源·github·好物分享
AC赳赳老秦1 天前
HR必备:OpenClaw批量筛选简历、发送面试通知,优化招聘流程
运维·人工智能·python·eclipse·github·deepseek·openclaw
yyuuuzz1 天前
独立站搭建:从入门到避坑实战
前端·git·github
splage1 天前
Nginx 反向代理之upstream模块以及完整配置反向代理示例
git·nginx·github