Use SSHTool to convert Putty Private Key to OpenSS

2019-07-20 15:59发布

问题:

In my java project I create a SSH tunnel with a server. The tunnel is authenticated currently using a putty private key and plink. Does anybody know how to use the java SSHTool library to either convert a putty key to a openssh key or use SSHTool library to create a ssh tunnel using a putty key? Thank you.

回答1:

Jsch only accepts opensh keys, not the format that putty creates the keys in. You would have to convert them. Use puttygen.exe to convert to openssh, then use the openssh keyfile in jsch.