简体   繁体   中英

Authenticate using .ppk private key using SSH.NET library

I am trying to login to the remote SFTP server from my .NET code using Renci.SshNet library using .ppk format private key. It is showing error.

I know it will work with.PEM format. But as the key for the application is generated by client, I can't change the format.

Is there a way to use.ppk private key to authenticate and upload file from my .NET C# code?

Any suitable library?

It has to be PEM format if you want to keep using SSH.NET. So either they generate the key in PEM format. Or at least they convert it to the PEM format. Or your software will have to convert it.

I'm not aware of any library that can do the conversion. All I can suggest is that you use bundle some command-line tool that can do it. For example my WinSCP can do that .
See Convert.pem key file to.ppk in Windows automatically/script/command line .


If want to change the library, you can use my WinSCP .NET assembly . It supports .ppk keys. But it's just a wrapper around WinSCP itself. So it's about the same as using WinSCP for the conversion.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM