“Renci.SshNet.Common.SshException: Invalid private key file” when loading SSH private key from configuration string using SSH.NET

As this is the top answer for that error message, so I think it’s worthwhile expanding on a point in your original question – converting to an OpenSSH format key. Renci.SshNet can’t use PuTTY keys that start with: PuTTY-User-Key-File-2: ssh-rsa You can use puttygen.exe to convert to the OpenSSH format load your key file in … Read more