SSH Key Authentication Fails with macOS Ventura
See original GitHub issueWhen I try to authenticate with an RSA SSH key from Windows into macOS Ventura, I get a Permission denied (publickey). error. However, If I run the same code against macOS Monterrey, it works correctly.
I’m attaching a repro solution so you can give it a try.
Repro Steps:
-
Pre-requisites:
- Copy the content of the
testKey.pubfile (included in the test project) into/Users/.<userName>/ssh/authorized_keysin the Mac
- Copy the content of the
-
Assign the corresponding values to the
hostanduserNamevariables in theProgram.csfile of the attached project -
Build and run the console app
Expected Results: the console should connect to the host with the given username and included private key (testKey)
Current Results: the console doesn’t connect and show a Permission denied (publickey). error instead
Notes:
-
The attached SSH key pair has been generated using this command:
ssh-keygen -b 2048 -t rsa -m PEM -f "<filePath/>" -q -N "<passPhrase/>" -
If I try to SSH connect to macOS Ventura with a Windows command prompt using the same key, it works correctly
Issue Analytics
- State:
- Created a year ago
- Reactions:5
- Comments:11

Top Related StackOverflow Question
This solution works for me 0. (Backup ~/.ssh/ folder)
As the solution mentioned by @phu-mai-jemmic and @giccifelipe works for rsa keys, but do you know how to fix it for ecdsa keys?