当前位置:网站首页 > 更多 > 编程开发 > 正文

[异常记录] 记 Git - Permission denied (publickey) 问题

作者:CC下载站 日期:2022-07-21 00:00:00 浏览:56 分类:编程开发

最近在 Centos 9 stream 上使用 ssh-keygen -t rsa -C "email" 生成密钥,在 coding 添加公钥后 clone 代码出现如下问题

[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

将密钥复制到本地电脑上进行测试,发现可以成功 clone 项目。

通过搜索发现 csdn 没有一个答案能解决问题(全是重复的文章),最后在国外网站找到了解决办法

解决方案

不使用 rsa 算法生成密钥,使用更安全的 ECDSA 或 ED25519 生成

ssh-keygen -t ed25519 -C "email"

coding 重新添加后,成功 clone 了项目。感觉可能是 OpenSSH 版本问题,有时间再测测看。

参考:https://confluence.atlassian.com/bitbucketserverkb/ssh-rsa-key-rejected-with-message-no-mutual-signature-algorithm-1026057701.html

您需要 登录账户 后才能发表评论

取消回复欢迎 发表评论:

关灯