升级MACOS 13.x后git(ssh)报错Permission denied (publickey,password).

191 阅读1分钟

原因

Mac 在更新版本后,OpenSSH 的版本提升到了 9.0,默认不支持 rsa 加密算法

解决方法

1. 手动声明支持rsa

检查~/.ssh下有没有config文件,没有则新建

config文件新增:

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

即可继续使用已有rsa密钥

2. 用另一种加密方式重新生成密钥

ssh-keygen -t ed25519 -C "your@example.email"