JSCH - Invalid private key

前端 未结 5 1813
甜味超标
甜味超标 2020-12-06 00:43

I am running JDK 1.7 & Windows 7 using netbeans 7.2 I have generated a SSH private & public key pair (SSH2-2048 bits) using putty-keygen. I do not have any password

5条回答
  •  忘掉有多难
    2020-12-06 01:34

    I guess that your key is not in OpenSSH key file format. JSch expects the private key to be in OpenSSH format.

    You can use PuTTYgen to convert your private key to work with OpenSSH by following the steps described here:

    1. Press Load and select the Private Key that was created with PuTTYgen.
    2. Enter the passphrase to load the key.
    3. From the Conversions menu select export OpenSSH key
    4. Save the private key.

提交回复
热议问题