Fix - DBeaver SSH tunnel connections fail with invalid privatekey error

Invalid privatekey error in DBeaver

I tried to connect to a remote Postgresql server with DBeaver and got this error today. The error message said my private key was invalid. To check this further, I tried to login to the server using the terminal as usual and it worked. So I realized the issue must be in DBeaver, and not in my private key.
After a few google searches, I learned that DBeaver does not support new OpenSSH private keys format by default. So as a workaround, I had to convert my key file to old PEM format using the following command and use it with DBeaver.

This will work if you already generated the keys with new format and want to use them with DBeaver.

ssh-keygen -p -m PEM -f ~/.ssh/id_rsa
If you want to generate new keys, use the following.

ssh-keygen -t rsa -b 4096 -m PEM

That’s it. I hope this will help someone.

1 comments :

  1. I have been married with my wife for 6 years and recently she broke up with me and it hurt me deeply when she told me to leave her alone and that she does not love me anymore when i was always faithful and honest to her. I tried all the ways to get her back buying her what she wants like i always did and she still left me heart broken and she even has a new boyfriend which destroyed me even more until a friend of mine from high school directed me to Dr Emu. This man changed my life completely. I followed everything he told me to do and my wife came back. I was stunned everything happened exactly like he told me. I had faith in everything he told me and everything was true. You can contact him via email: Emutemple@gmail.com He will help you in anything you need and quick to answer once you contact him through his whats-app number: +2347012841542
    For more destails about Dr Emu you can visit his Website: http://emutemple.website2.me/

    ReplyDelete