Cannot use RSA key generated by PuTTYgen

Jul 7, 2016 at 9:03 AM
Hi,

I've been trying to use RSA keys generated by PuTTYgen using the (default) "SSH 2 (RSA)" option instead of the keys I was previously generating using MKS Toolkit's ssh-keygen.

With the keys generated with PuTTYgen I get:

Invalid data type, INTEGER(02) is expected.

when creating an instance of SshClient (the PowerShell Posh-SSH module does this for me when I invoke New-SSHSession)

I expect it's possible to use keys generated by PuTTYgen, so what I am doing wrong?

Thanks in advance for your help.
Mar 13 at 9:18 PM
Sharing the solution by answering my own question...

The solution is: generate the key with MobaXterm's generator, and use the "Export OpenSSH key" (not "Export OpenSSH key (force new file format)" option. This is the only option that generates a private key file compatible with the PowerShell Posh-SSH module.