ssh invalid privatekey

Moderators: Vladimir Kondratyev, Anton Katilin

Post Reply
albersma
Posts: 1
Joined: Wed May 11, 2022 4:37 pm

ssh invalid privatekey

Post by albersma »

I want to connect to remote server to profile a running tomcat.
I haven chosen "Profile remote Java EE Server or application",
then used the Advanced option of "Application discovery method".
then I entered the hostname, ssh user and my private ssh-key and clicked on "Test Connection".

Then I got the error: "Error. Failed to authenticate to ..."
The log file says:
22.3-100 335.818: com.yourkit.an.as: com.jcraft.jsch.JSchException: invalid privatekey: [[email protected]
at com.jcraft.jsch.KeyPair.load(KeyPair.java:664)
at com.jcraft.jsch.KeyPair.load(KeyPair.java:561)
at com.jcraft.jsch.IdentityFile.newInstance(IdentityFile.java:40)
at com.jcraft.jsch.JSch.addIdentity(JSch.java:406)
at com.yourkit.ac.c.g.yw(a:151)
at com.yourkit.ac.c.g.yv(a:126)
at com.yourkit.ac.c.g.b(a:299)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at com.yourkit.ac.c.i.run(a:83)

But my private key file is exactly the same, which I use when connecting manually via ssh command, which works.
What's wrong here?
Anton Katilin
Posts: 6130
Joined: Wed Aug 11, 2004 8:37 am
Contact:

Re: ssh invalid privatekey

Post by Anton Katilin »

Perhaps its format is unsupported and you'll need to re-generate/convert the key:
https://stackoverflow.com/questions/531 ... using-jsch
Post Reply