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

相关推荐
uhakadotcom1 小时前
NVIDIA CUDA Python 常用 API 及详细教程
算法·面试·github
李贺梖梖2 小时前
Git初识
git
~央千澈~2 小时前
git大文件储存机制是什么-为什么有大文件会出错并且处理大文件非常麻烦-优雅草卓伊凡
git
Komorebi_99994 小时前
Git 常用命令完整指南
大数据·git·elasticsearch
逛逛GitHub4 小时前
这个 GitHub 项目牛逼!在手机上用 Claude Code 或 Codex。
github
stark张宇5 小时前
Git 与 GitHub 协同工作流:从0到1搭建版本控制体系
git·gitlab·github
爱吃生蚝的于勒6 小时前
【Linux】零基础学会Linux之权限
linux·运维·服务器·数据结构·git·算法·github
数字冰雹6 小时前
图观 流渲染打包服务器
服务器·前端·github·数据可视化
白鲸开源6 小时前
3.1.8<3.2.0<3.3.1,Apache DolphinScheduler集群升级避坑指南
java·开源·github
minji...6 小时前
Linux相关工具vim/gcc/g++/gdb/cgdb的使用详解
linux·运维·服务器·c++·git·自动化·vim