运行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

相关推荐
Xi-Xu28 分钟前
隆重介绍 Xget for Chrome:您的终极下载加速器
前端·网络·chrome·经验分享·github
朱颜辞镜花辞树‎1 小时前
GitHub 操作指南:项目协作与自动化工作流实践
运维·自动化·github
音元系统2 小时前
Copilot 在 VS Code 中的免费替代方案
python·github·copilot
乌云暮年5 小时前
Linux常用命令
linux·服务器·ssh·php
ai小鬼头6 小时前
AIStarter3.0.2全新发布:解锁用户、创作者、共创模式,轻松玩转AI项目
人工智能·程序员·github
寻月隐君8 小时前
用 Rust 实现 HTTPie:一个现代 CLI 工具的构建过程
后端·rust·github
徐小夕9 小时前
开源了一款基于Nextjs实现的精美CRM系统, 卷王程序员狂喜!
前端·react.js·github
Casia_Dominic10 小时前
【三维重建工具】NeRFStudio、3D GaussianSplatting、Colmap安装与使用指南
git·3d·github·点云
寻月隐君20 小时前
想用 Rust 开发游戏?这份超详细的入门教程请收好!
后端·rust·github