现象:GitHub 正常,但是内网 Git SSH Key 认证失败,无法拉取代码。
Permission denied (publickey,password).
fatal: Could not read from remote repository.
开了下 Debug ,定位到问题。
debug1: send_pubkey_test: no mutual signature algorithm
debug1: No more authentication methods to try.
因为 Ventura 自带 OpenSSH_9.0p1 而从 8.2 开始 OpenSSH 默认不再支持 ssh-rsa,所以认证失败。
解法:使用新的算法生成密钥(推荐 ED25519 )或者临时开启 ssh-rsa 支持。
Host xxxx
User xxx
PreferredAuthentications publickey
HostKeyAlgorithms +ssh-rsa
PubkeyAcceptedKeyTypes +ssh-rsa
希望对大家有用。