SharpSSH invalid privatekey

岁酱吖の 提交于 2019-12-08 14:39:20

问题


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?


回答1:


You have to convert your key to OpenSSH Format:

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



来源:https://stackoverflow.com/questions/13449525/sharpssh-invalid-privatekey

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!