dbeaver: Cannot establish tunnel to Ubuntu 22.04 server

System information: Version

  • Microsoft Windows 10 Pro (10.0.18363 Build 18363)
  • DBeaver 22.1.0.202206051253 (June 6, 2022)
  • No additional extension

Connection specification:

  • Database : PostgreSQL 14.3
  • Driver : org.postgresql:postgresql:RELEASE 42.2.5
  • SSH Tunnel used

Describe the problem you’re observing:

I (try to) use an SSH Tunnel but I cannot make it work. When I click on “Test tunnel configuration”, I get the message “Cannot establish tunnel to [XX.XX.XX.XX]:22” and “Auth fail”.

image

I am familiar with this procedure and I use it very often for Ubuntu 18.04 and 20.04 servers. Here, my new server runs Ubuntu 22.04 and I cannot make it work.

I have checked using other tools that I can indeed establish the SSH Tunnel with my new server. For example, the database tool of PhpStorm connects successfully to this database, with the same configuration for the tunnel.

I include the full logs below, could you please tell me if this is a bug or what to try next?

Steps to reproduce, if exist:

Include any warning/errors/backtraces from the logs

> Start DBeaver SSH tunnels UI [org.jkiss.dbeaver.net.ssh.ui 1.0.104.202206051253]
> Start DBeaver SSH tunnels [org.jkiss.dbeaver.net.ssh 1.0.104.202206051253]
2022-06-21 13:52:35.922 - Service 'org.jkiss.dbeaver.runtime.ui.UIServiceSecurity' not found
> Start Java Native Access [com.sun.jna 5.8.0.v20210503-0343]
> Start DBeaver SSH implementation (JSch) [org.jkiss.dbeaver.net.ssh.jsch 1.1.93.202206051253]
2022-06-21 13:52:37.818 - Adding identity key
2022-06-21 13:52:37.834 - Configure tunnel
> Start Noyau JSch [org.eclipse.jsch.core 1.3.900.v20200422-1935]
> Start Interface utilisateur JSch [org.eclipse.jsch.ui 1.4.100.v20210917-1201]
2022-06-21 13:52:37.849 - Connect to tunnel host
2022-06-21 13:52:37.849 - SSH INFO: Connecting to [EDITED-FOR-PRIVACY] port 22
2022-06-21 13:52:37.919 - SSH INFO: Connection established
2022-06-21 13:52:37.950 - SSH INFO: Remote version string: SSH-2.0-OpenSSH_8.9p1 Ubuntu-3
2022-06-21 13:52:37.950 - SSH INFO: Local version string: SSH-2.0-JSCH-0.1.54
2022-06-21 13:52:37.950 - SSH INFO: CheckCiphers: aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,3des-ctr,arcfour,arcfour128,arcfour256
2022-06-21 13:52:37.950 - SSH INFO: CheckKexes: diffie-hellman-group14-sha1,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521
2022-06-21 13:52:38.003 - SSH INFO: CheckSignatures: ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
2022-06-21 13:52:38.003 - SSH INFO: SSH_MSG_KEXINIT sent
2022-06-21 13:52:38.019 - SSH INFO: SSH_MSG_KEXINIT received
2022-06-21 13:52:38.019 - SSH INFO: kex: server: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,sntrup761x25519-sha512@openssh.com,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256
2022-06-21 13:52:38.019 - SSH INFO: kex: server: rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519
2022-06-21 13:52:38.019 - SSH INFO: kex: server: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
2022-06-21 13:52:38.019 - SSH INFO: kex: server: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
2022-06-21 13:52:38.019 - SSH INFO: kex: server: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
2022-06-21 13:52:38.019 - SSH INFO: kex: server: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
2022-06-21 13:52:38.019 - SSH INFO: kex: server: none,zlib@openssh.com
2022-06-21 13:52:38.019 - SSH INFO: kex: server: none,zlib@openssh.com
2022-06-21 13:52:38.019 - SSH INFO: kex: server: 
2022-06-21 13:52:38.019 - SSH INFO: kex: server: 
2022-06-21 13:52:38.019 - SSH INFO: kex: client: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
2022-06-21 13:52:38.019 - SSH INFO: kex: client: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
2022-06-21 13:52:38.019 - SSH INFO: kex: client: aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc,aes192-ctr,aes192-cbc,aes256-ctr,aes256-cbc
2022-06-21 13:52:38.019 - SSH INFO: kex: client: aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc,aes192-ctr,aes192-cbc,aes256-ctr,aes256-cbc
2022-06-21 13:52:38.019 - SSH INFO: kex: client: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96
2022-06-21 13:52:38.019 - SSH INFO: kex: client: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96
2022-06-21 13:52:38.019 - SSH INFO: kex: client: none
2022-06-21 13:52:38.019 - SSH INFO: kex: client: none
2022-06-21 13:52:38.019 - SSH INFO: kex: client: 
2022-06-21 13:52:38.019 - SSH INFO: kex: client: 
2022-06-21 13:52:38.019 - SSH INFO: kex: server->client aes128-ctr hmac-sha1 none
2022-06-21 13:52:38.019 - SSH INFO: kex: client->server aes128-ctr hmac-sha1 none
2022-06-21 13:52:38.019 - SSH INFO: SSH_MSG_KEX_ECDH_INIT sent
2022-06-21 13:52:38.019 - SSH INFO: expecting SSH_MSG_KEX_ECDH_REPLY
2022-06-21 13:52:38.066 - SSH INFO: Host '[EDITED-FOR-PRIVACY]' is known and matches the ECDSA host key
2022-06-21 13:52:38.066 - SSH INFO: SSH_MSG_NEWKEYS sent
2022-06-21 13:52:38.066 - SSH INFO: SSH_MSG_NEWKEYS received
2022-06-21 13:52:38.066 - SSH INFO: SSH_MSG_SERVICE_REQUEST sent
2022-06-21 13:52:38.104 - SSH INFO: SSH_MSG_SERVICE_ACCEPT received
2022-06-21 13:52:38.166 - SSH INFO: Authentications that can continue: publickey,keyboard-interactive,password
2022-06-21 13:52:38.172 - SSH INFO: Next authentication method: publickey
2022-06-21 13:52:38.220 - SSH INFO: Disconnecting from [EDITED-FOR-PRIVACY] port 22
2022-06-21 13:52:38.320 - Auth fail
com.jcraft.jsch.JSchException: Auth fail
	at com.jcraft.jsch.Session.connect(Session.java:519)
	at com.jcraft.jsch.Session.connect(Session.java:183)
	at org.jkiss.dbeaver.model.net.ssh.SSHImplementationJsch.setupTunnel(SSHImplementationJsch.java:116)
	at org.jkiss.dbeaver.model.net.ssh.SSHImplementationAbstract.initTunnel(SSHImplementationAbstract.java:134)
	at org.jkiss.dbeaver.model.net.ssh.SSHTunnelImpl.initializeHandler(SSHTunnelImpl.java:76)
	at org.jkiss.dbeaver.ui.net.ssh.SSHTunnelConfiguratorUI$7.execute(SSHTunnelConfiguratorUI.java:247)
	at org.jkiss.dbeaver.ui.net.ssh.SSHTunnelConfiguratorUI$TunnelConnectionTestJob.run(SSHTunnelConfiguratorUI.java:593)
	at org.jkiss.dbeaver.model.runtime.AbstractJob.run(AbstractJob.java:105)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 3
  • Comments: 16 (3 by maintainers)

Commits related to this issue

Most upvoted comments

Hi, It now works correctly using SSHJ (not with JSch though). I would like to thank all the persons involved in this correction! Thanks for building and maintaining such a great tool.

Hi, I had the same issue, DBeaver was unable to use my SSH tunnel while there was no issue with the terminal. More than that, only one tunnel had this issue, we duplicated the server and the ssh tunnel and there was no problem there.

The problem is the server had multiple public keys, and for some reason Dbeaver wasn’t using the “good” one, only the key listed in the “known hosts”. The terminal command ssh handle that characteristic like a charm.

The solution:

ssh-keyscan -H example.com >> ~/.ssh/known_hosts

That made DBeaver connection a success without restarting the app 🚀

Hope that helps

The solution:

ssh-keyscan -H example.com >> ~/.ssh/known_hosts

That made DBeaver connection a success without restarting the app 🚀

Thank you @TOMHTML. I have been struggling for weeks with this issue. Your solution worked immediately! (Dbeaver 22.1.4 connecting to Ubuntu 22.04 via SSHJ tunnel).