Description
When 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.pub
file (included in the test project) into/Users/.<userName>/ssh/authorized_keys
in the Mac
- Copy the content of the
-
Assign the corresponding values to the
host
anduserName
variables in theProgram.cs
file 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