使用代理连接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是否成功连接
相关推荐
狂炫冰美式8 小时前
你还在古法PPT吗,试试HTML呢?免费编辑导出工具给 xdm 放这了
前端·后端·github
Thecozzy10 小时前
PR经历(Understand-Anything)
github
猎奇不再看13 小时前
MAF的Agent详解:连接LLM的IChatClient对象
github
_Evan_Yao14 小时前
一文搞懂:Git分支管理与团队协作规范——从GitFlow到GitHub Flow,从rebase到merge,打造高效协作流
java·git·后端·github
lxw184491251415 小时前
github 提示双因素认证
github
逛逛GitHub15 小时前
你的 AI Agent 每次请求都在干嘛?这个开源项目帮你扒个底朝天。
github
用户4802615847015 小时前
Remeda:data-first 和 data-last,它全都要
github
花椒技术17 小时前
AI 代码评审落地实践:GitLab 接入、项目规则与反馈闭环
后端·github·agent
袋子(PJ)17 小时前
2026最新GitHub发布项目全过程
git·github
拓研C18 小时前
EM-Core-Agent:AI Agent 具身认知核心系统——架构白皮书 V1.0
人工智能·架构·车载系统·机器人·github