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

相关推荐
互联网中的一颗神经元2 小时前
19 — 贮藏与清理:stash 是抽屉,gc 是打包箱
git
MicrosoftReactor3 小时前
技术速递|GitHub Copilot App 中的堆叠会话与拉取请求
ai·github·copilot·agent
dong_junshuai4 小时前
每天一个开源项目#67 Orca:4.3万星的并行 AI 编程控制台
程序员·开源·github
用户330144867634 小时前
20 — 远程进阶:强制推送的保险绳——force-with-lease
git
Cooper254 小时前
别急着改 Git 历史:rebase、cherry-pick、bisect 与 reflog 的安全操作顺序
git
峰向AI5 小时前
AI 画图要好看,还是要可信?小孩子才做选择,我两个都要!
github
刚入门的大一新生5 小时前
Linux-版本控制器Git
git
扶苏10025 小时前
同一个 Git 项目整出两份,切分支互不影响?两种方案实测
大数据·git·elasticsearch
ZJU_统一阿萨姆6 小时前
【Git】Github 开源许可证详解
git·开源·github
fthux14 小时前
装闭 RenoPit 源码解析(07):装修闭坑知识库与AI Prompt构建
人工智能·ai·开源·github·open source·renopit