I am trying to use DBeaver to connect to a PostgreSQL database server through SSH:
can't initialize tunnel
cannot establish tunnel
com.jcraft.jsch.JSchException: auth fail
I am sure the SSH server is working fine. I manage to connect to the same PostgreSQL database server through the same SSH server with pgAdmin 3 and RazorSQL. I have checked the IP, username and password, they are correct. I disabled all firewalls. What could be the issue?
My settings:
I use DBeaver 3.7.3 x64 portable version with Windows 7 SP1 x64 Ultimate.
The error log window does not log the error, so I don't have any more information there.
Best Answer
I tried DBweaver on Kubuntu and had the same issue. It looks like the issue is around the fact that the authenticity of the SSH server hadn't been verified beforehand, and DBweaver and unable to cascade the correct error message (e.g.,
Host key verification failed.
) and instead misleadingly blames some authentication error.I fixed the issue on Kubuntu as follows:
Run in the shell
sudo apt-get install -y autossh
Add the shell command in your connection in DBeaver:
At that point if you try to connect you'll have the same
com.jcraft.jsch.JSchException: auth fail
error message. Go to the shell and run the command:it will output:
Go back to DBeaver, try to connect, that should work. I still don't know why I should use
autossh
instead of the SSH tunnel tab in DBeaver though.