git版本导致的"Permission denied (publickey). fatal: Could not read from remote repository."

在做了ssh key配置后,依然报这个错的话,可能是 git版本问题。

git在2.33后就不支持ssh-rsa,客户端默认禁用了ssh-rsa。

解决方法

编辑 ~/.ssh 目录下的 config 文件(一般有特殊需求才需要修改此文件),如果没有,就需要创建。

添加内容:

Host *
    HostKeyAlgorithms +ssh-rsa
    PubkeyAcceptedKeyTypes +ssh-rsa

 

 

 

 

参考博客:【Git】解决方案:Permission denied (publickey). fatal: Could not read from remote repository.

参考博客中讲的更多

 

 

 

 

 

 

 

 

 

 


老虎

 

posted @ 2025-12-18 17:50  yeren2046  阅读(4)  评论(0)    收藏  举报