运行ssh -T git@github.com报错

运行ssh -T git@github.com报错

no such identity: /root/.ssh/id_rsa: No such file or directory

git@ssh.github.com: Permission denied (publickey).

如果我用的是ed25519而非rsa,有id_ed25519

则需要打开~/.ssh/config检查一下是否写错了

vim ~/.ssh/config

然后发现果然写错了

应该是

IdentityFile ~/.ssh/id_ed25519

而非rsa

网上的这份答案除了id_rsa这里需要注意外其他都是合适的。

Host github.com

Hostname ssh.github.com

User git

Port 443

PreferredAuthentications publickey

IdentityFile ~/.ssh/id_ed25519

相关推荐
weixin_6682 小时前
GitHub 2026年AI项目详细数据汇总表-AI分析-分享
人工智能·github
CoderJia程序员甲18 小时前
GitHub 热榜项目 - 日榜(2026-02-05)
ai·开源·大模型·github·ai教程
stevenzqzq19 小时前
git 常用操作
大数据·git
weixin_66820 小时前
GitHub 2026年AI项目热度分析报告-AI分析-分享
人工智能·github
Curvatureflight21 小时前
Git工作流最佳实践:从混乱到优雅
git
MicrosoftReactor21 小时前
技术速递|GitHub Copilot CLI 斜杠命令速查表
github·copilot·cli
wu~9701 天前
GitHub永不遗忘,使用git push -f来覆盖的提交依旧保留
git·github
m0_694845571 天前
music-website 是什么?前后端分离音乐网站部署实战
linux·运维·服务器·云计算·github
独自破碎E1 天前
已经 Push 到远程的提交,如何修改 Commit 信息?
开发语言·github
Vermouth_001 天前
git clone的时候提示access denied
git