After upgrading to macOS 13 Ventura, I suddenly found that git push stopped working and failed with:
1 | Permission denied (publickey). |
After repeatedly confirming that my public key was still present on GitLab, I found discussions مثل this one:
https://superuser.com/questions/1749364/git-ssh-permission-denied-in-macos-13-ventura
The likely cause is that the bundled OpenSSH_9.0p1 in macOS 13 disables RSA/SHA-1 by default.
There are two main ways to fix it.
Option 1: Generate a new key
This is the cleaner option, though it can be more expensive if you need to update the key in multiple places:
1 | ssh-keygen -t ed25519 |
Option 2: Re-enable RSA in SSH config
Edit ~/.ssh/config and add:
1 | Host * |
This can also help when the remote server is too old to support newer algorithms.