SFTP using PPK files

0 votes
asked Jan 29, 2010 by simon (120 points)
edited Jan 31, 2010

we are having problems sending sFTP messages using your sFTP tool with PPK private keys. We have managed to use .pem keys, but our company standard is using .ppk

we currently have a trial version , would you be able to confirm we can use .ppk and maybe send some sample code.

we are using the FTPack.1

thanks

Applies to: Rebex SFTP

1 Answer

+1 vote
answered Jan 31, 2010 by Lukas Pokorny (100,670 points)
edited Jan 31, 2010

PuTTY .ppk private key format are supported. To authenticate using a .ppk private key, it should be possible to use the same code asfor .pem keys:

 // create client and connect 
 Sftp client = new Sftp();
 client.Connect(hostname);

 // verify the server's fingerprint (client.Fingerprint) 
 ...

 // load the private key
 SshPrivateKey privateKey = new SshPrivateKey("key_rsa.ppk", "password");

 // authenticate using the key
 client.Login(username, privateKey);

If this doesn't work, please let us know what kind of exception you get, we should be able to solve it. Does it fail when initializing the SshPrivateKey or inside the Login method?

If it's the Login method, a communication log produced using the Sftp object's LogWriter property (as described at http://www.rebex.net/kb/logging.aspx) might help - you can send it to support@rebex.net for analysis.

...