I use SharpSSH to connect to a stfp-server.
This for I need to add a privatekey-file like this:
sftp.AddIdentityFile(KeyFilePath);
But this throws an exception:
invaid privatekey: C:\KeyFile\privatekey_2.ppk
The file was created with puttygen and works with filezilla. The privatekey-type doesn't matter (SSH-1 RSA, SSH-2 RSA, SSH-2 DSA). Everytime the same result.
Do you know how to handle this problem?
You have to convert your key to OpenSSH Format:
Use PuttyGen to generate and convert the key (Conversion -> export OpenSSH Key)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With