苹果 macOS 13 Ventura 升级后 id_rsa.pub公钥失效问题

769 阅读1分钟

macOS系统升级到 Ventura(13.0)后出现较多问题,本次讲git权限消失的问题,系统更新后run: git pull 出现一下错误:

git@gitlab.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

既然公钥被拒绝,首先想到的是更新一下秘钥,然而结果却不行。 经过查找发现 系统升级后 openSSH 由之前的OpenSSH_8.6p1升级到OpenSSH_9.0p1,升级后的ssh-rsa 公钥签名算法将在未来发布的版本中默认禁用。也就是说默认不能用 我们在配置中~/.ssh/config添加

Host *
PubKeyAcceptedKeyTypes=+ssh-rsa

既可以解决问题,当然也可以使用其他算法生成秘钥对。