Open lordofthejars opened 8 years ago
@yegor256 please do something about this issue
@lordofthejars looks correct to me. what exactly do you see? can you post stacktrace here?
Sorry for being a bit late, JavaOne thing hehehe:
java.io.IOException: com.jcraft.jsch.JSchException: invalid privatekey: [B@24a1c17f
at com.jcabi.ssh.SSH.session(SSH.java:279)
at com.jcabi.ssh.SSH.exec(SSH.java:219)
at com.jcabi.ssh.Shell$Plain.exec(Shell.java:172)
Caused by: com.jcraft.jsch.JSchException: invalid privatekey: [B@24a1c17f
at com.jcraft.jsch.KeyPair.load(KeyPair.java:902)
at com.jcraft.jsch.KeyPair.load(KeyPair.java:543)
at com.jcraft.jsch.IdentityFile.newInstance(IdentityFile.java:40)
at com.jcraft.jsch.JSch.addIdentity(JSch.java:393)
at com.jcraft.jsch.JSch.addIdentity(JSch.java:353)
at com.jcabi.ssh.SSH.session(SSH.java:261)
Any idea? Maybe I need to install something?
Any news on this ? I got the same error but I know the key is valid, since I use it almost everyday
No answer, I tried everything but didn't work and I decided to give up.
Disappointed to hear this but thanks for the info !
If it may interest others, I was able to fix my problem. It turns out that my private key need a passphrase. By switching to 2.0-snapshot, and using the new constructor (https://github.com/jcabi/jcabi-ssh/issues/50) I was able to make it work.
I have the same problem. It was my mistake. I forget to put a "\n" at the end of each line, in my key string.
I have the same problem. It was my mistake. I forget to put a "\n" at the end of each line, in my key string.
Same with me, I had to edit my private key file (.ppk) to replace the \r with an \n, at the end of each line. I did this easily in Notepad++ with Find/Replace, Extended search mode, find "\r" and replace with "\n".
I am trying to use a private key generated with OpenSSH, but I always get an invalid private key exception. I am using Java8 and jcabi-ssh 1.5. The private key is (it is for testing purposes):
And the code I am using:
Anything that I am going wrong, do I need another dependency?