dbeaver: "invalid privatekey" connecting through SSH tunnel
Connection specification:
MySQL connection via SSH Tunnel to Ubuntu 16.04 server
Describe the problem you’re observing:
Just done a fresh install on my laptop and now cannot connect to remote server using the new SSH key I generated.
Key was generated like so: ssh-keygen -t rsa -b 4096 -C
I can connect to the server in question just fine via ssh user@host in a terminal but with the same host, user and private key reference under the ‘SSH Tunnel’ tab I get:
Can't initialize tunnel
Cannot establish tunnel
Cannot establish tunnel
invalid privatekey: [B@7696c31f
invalid privatekey: [B@7696c31f
I added the SSHJ extension after reading through similar issues but it’s not helped
Am I missing something?
System information:
- DBeaver
6.0.3.201904211926 org.jkiss.dbeaver.core.product - DBeaver SSHJ
.0.28.201904211926 org.jkiss.dbeaver.net.sshj.feature.feature.group JKISS - Host OS: Fedora 30
- Open SSL version:
OpenSSH_7.9p1, OpenSSL 1.1.1b FIPS 26 Feb 2019 - java -version:
openjdk version "1.8.0_201"
OpenJDK Runtime Environment (build 1.8.0_201-b09)
OpenJDK 64-Bit Server VM (build 25.201-b09, mixed mode)
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 38
- Comments: 44 (8 by maintainers)
Commits related to this issue
- #5845 Try to use system 'ssh-keygen' to convert key into appropriate format — committed to dbeaver/dbeaver by ShadelessFox 4 years ago
- #5845 Better failure message reporting — committed to dbeaver/dbeaver by ShadelessFox 4 years ago
- #5845 Set timeout for running process — committed to dbeaver/dbeaver by ShadelessFox 4 years ago
- #5845 Allow password with spaces — committed to dbeaver/dbeaver by ShadelessFox 4 years ago
- #5845 Join message lines by newline — committed to dbeaver/dbeaver by ShadelessFox 4 years ago
- Merge pull request #9829 from dbeaver/jsch-openssh-key#5845 #5845 Try to use system 'ssh-keygen' — committed to dbeaver/dbeaver by serge-rider 4 years ago
- #5845 Fix for ssh-keygen command — committed to dbeaver/dbeaver by ShadelessFox 4 years ago
- Merge pull request #10289 from dbeaver/ssh-privatekey-jsch#5845 #5845 Fix for ssh-keygen command — committed to dbeaver/dbeaver by serge-rider 4 years ago
- #5845 Supply randomly generated password for ssh-keygen — committed to dbeaver/dbeaver by ShadelessFox 4 years ago
- #5845 Only quote the password on Windows — committed to dbeaver/dbeaver by ShadelessFox 4 years ago
- Merge pull request #10321 from dbeaver/ssh-privatekey-jsch-linux#5845 #5845 Only quote the password on Windows — committed to dbeaver/dbeaver by serge-rider 4 years ago
Run this on your key to convert it to RSA private key. Helped me.
ssh-keygen -p -m PEM -f ~/.ssh/id_rsaprivate key generated by
ssh-keygenstarts with-----BEGIN OPENSSH PRIVATE KEY-----and not-----BEGIN RSA PRIVATE KEY-----and this is not supported by DBeaver.
To generate supported key add
-m PEMto the end of your ssh-keygen commande.g.
ssh-keygen -t rsa -b 2048 -m PEM@fancywriter Could you try SSHJ instead of JSch (Help->Install New Software->https://dbeaver.io/update/sshj/latest/)?
would be great to support newer openssh formats though?
Hi! Im in same situation, solution from @nimda7 worked for me! Once you install the plugin, change it in “Implementation” dropdown option:
Thanks!
Could we have a better error description than “invalid private key”. We had an issue where ssh connection with the key was possible, but dbeaver couldn’t because of the “invalid private key” error - and it wasn’t obvious that the format was not support by the program. 🤷♂️
Thanks
While using SSHJ does work when saving the password of a protected ed25519 private key, there is no password popup when trying to connect after closing the connection settings.
I get the following error message:
Does anybody else have this? And is there a fix for it?
Unfortunately, SSHJ does not seem to work with DBeaver 7.0.0. This is the error:
works great. to bad that openssh keys dont work though 😃
Could you add this to the wiki ? Thanks !
@kuriel-trivu,
The SSHJ extension is now bundled with DBeaver, so I guess that’s the reason why you’re getting this error.
I confirm issue on archlinux with an openssh key (Dbeaver 7.2.3 using Jsch).
Specified private key cannot be converted: Saving key "/tmp/.dbeaver-temp6234629892423691601/mysql5-16917676b1b-4955161a3b0189da.pem" failed: passphrase is too short (minimum five characters).Works fine with SSHj plugins (thanks to @bradmccormack for workaround 😃 )
Dbeaver: DBeaver 7.2.3 org.jkiss.dbeaver.core.product null => 7.2.3.202010232212
JSch: Eclipse Orbit JSch 0.1.55.v20190404-1902 com.jcraft.jsch Eclipse.org JSch Core 1.3.800.v20200106-0907 org.eclipse.jsch.core Eclipse.org JSch UI 1.3.800.v20200205-0619 org.eclipse.jsch.ui
Reopen issue please,
That’s right, the SSHJ option is hidden in SSH under Advanced options.
Thanks for the information, @DevJackSmith.
Looks like your
ssh-keygenjust converted key to the same format as it was before.To keep the issue tracked, please create a separate ticket on our board.
@ShadelessFox it is
-----BEGIN OPENSSH PRIVATE KEY-----I tried running thessh-keygen -p -m PEM -f ~/.ssh/id_rsaon it, and it didn’t do anything, here’s the output when i run that command:More info on the key:
ssh-keygen -l -freturns:256 SHA256:...<edited>... (ED25519)@ccayg-sainsburys I get prompted to update SSHJ every time I update DBeaver itself. You might want to manually check for updates in case this screen does not show up automatically.
thanks! it works for me.
Your private key file must be in OpenSSH format to work in DBeaver. Format convertion info: https://burnz.wordpress.com/2007/12/14/ssh-convert-openssh-to-ssh2-and-vise-versa/
any luck on this? Having the same issue.