Mac 13.0 Ventura系统下Git SSH失败(Permission denied (publickey))

232 阅读1分钟

1.问题描述

更新Mac 13.0 Ventura后,git push 时发现:

Permission denied (publickey).

为此,我按照网上教程配置了多遍也没有用。。。

2.问题原因

在最新Mac 13.0 Ventura时,其附带的openSHH版本也会更新,如下所示

image.png

根据 OpenSSH说明:

This release disables RSA signatures using the SHA-1 hash algorithm by default.

此版本默认使用 SHA-1 哈希算法禁用 RSA 签名。

3.解决方案

git生成秘钥的方法切到ed25519,弃用rsa

ssh-keygen -t ed25519 -C "your email"