Description
A NotSupportedException is thrown when generating SSH keys with the "ssh-keygen" command on a Mac with macOS Mojave 10.14.1. With lower versions it's working fine.
Exception:
System.NotSupportedException: Key 'OPENSSH' is not supported.
at Renci.SshNet.PrivateKeyFile.Open(Stream privateKey, String passPhrase)
at Renci.SshNet.PrivateKeyFile..ctor(String fileName, String passPhrase)
Inspecting the generated private key I can see that the header starts with:
"-----BEGIN OPENSSH PRIVATE KEY-----"
Also, If I inspect a private key generated in a Mac with a lower macOS version, I can see something like:
"-----BEGIN RSA PRIVATE KEY-----"
The following code in this repo tries to match a Regex to detect they key name and act based on it. For this reason, It doesn't recognize "OPENSSH" as a valid private key name and it fails:
SSH.NET/src/Renci.SshNet/PrivateKeyFile.cs
Lines 190 to 273 in bd01d97
Thanks.