SharpSSH invalid privatekey

11,552

You have to convert your key to OpenSSH Format:

Use PuttyGen to generate and convert the key (Conversion -> export OpenSSH Key)

Share:
11,552
abc
Author by

abc

Updated on June 04, 2022

Comments

  • abc
    abc almost 2 years

    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?