使用代理连接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是否成功连接
相关推荐
irpywp13 小时前
合盖断网打断后台计算,Modafinil:一款防休眠菜单栏工具,让 Mac 闭眼继续跑 Agent
macos·ios·开源·github
_风满楼13 小时前
TDD 进阶:换个角度看会议室预约
前端·javascript·github
逛逛GitHub18 小时前
GitHub 上狂揽 2.4 万 Star!输入一个用户名,就能查遍 3000+ 网站。
github
DogDaoDao18 小时前
【GitHub】Ruflo:面向 Claude Code 的企业级多智能体编排平台深度解析
人工智能·深度学习·大模型·github·ai编程·claude·ruflo
小王的测试人生18 小时前
sindresorhusp-queue JavaScript 异步并发控制器
github
用户14516927284418 小时前
Chroma:AI应用的开源向量数据基础设施
github
lwf00616419 小时前
GitHub Pages + Cloudflare 自定义域名完整配置
github
冴羽yayujs19 小时前
GitHub 前端热榜项目 - 日榜(2026-05-11)
前端·github
2601_9560028120 小时前
我的世界2026最新绿色破解版免费下载 手机版通用
github·电脑·游戏程序·游戏美术·关卡设计
Harvy_没救了20 小时前
【github 爆款】Agent Skill项目全景汇报 + 联动deepseek-TUI
人工智能·github