dbeaver: SSH Tunnel - Cannot run program ssh-keygen error

I have SSHJ 1.0.73 installed and I’m running Dbeaver version 21.0.0.

When trying to set up a DB connection using an SSH tunnel, I get the following error:

Cannot run program "ssh-keygen": error=13,Permission denied error=13,Permission denied

My SSH key is already in OPENSSH format:

-----BEGIN OPENSSH PRIVATE KEY-----

[...]

-----END OPENSSH PRIVATE KEY-----

What should I do here? Thanks!

Edit: Found the error log

!ENTRY org.jkiss.dbeaver.model 4 0 2021-03-05 10:43:36.928
!MESSAGE error=13, Permission denied
!SUBENTRY 1 org.jkiss.dbeaver.model 4 0 2021-03-05 10:43:36.928
!MESSAGE error=13, Permission denied
!STACK 0
java.io.IOException: error=13, Permission denied
	at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
	at java.base/java.lang.ProcessImpl.<init>(Unknown Source)
	at java.base/java.lang.ProcessImpl.start(Unknown Source)
	at java.base/java.lang.ProcessBuilder.start(Unknown Source)
	at java.base/java.lang.ProcessBuilder.start(Unknown Source)
	at org.jkiss.dbeaver.model.net.ssh.SSHImplementationJsch.addIdentityKey(SSHImplementationJsch.java:189)
	at org.jkiss.dbeaver.model.net.ssh.SSHImplementationJsch.setupTunnel(SSHImplementationJsch.java:60)
	at org.jkiss.dbeaver.model.net.ssh.SSHImplementationAbstract.initTunnel(SSHImplementationAbstract.java:141)
	at org.jkiss.dbeaver.model.net.ssh.SSHTunnelImpl.initializeHandler(SSHTunnelImpl.java:75)
	at org.jkiss.dbeaver.ui.net.ssh.SSHTunnelConfiguratorUI.lambda$0(SSHTunnelConfiguratorUI.java:216)
	at org.jkiss.dbeaver.ui.UIUtils.lambda$14(UIUtils.java:1657)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 19 (4 by maintainers)

Most upvoted comments

Ditto timnolte. Just ran into this after upgrading to 22.3.4. I downgraded to 22.3.3 and I’m not seeing the issue there, so it must only just be in the last minor version.

I’m currently on Ubuntu 20.04

@AidanJHMurphy

To fix this set the ‘Implementation’ of your connection to SSHJ. You can find this under SSH -> Advanced Settings.

Ditto timnolte. Just ran into this after upgrading to 22.3.4. I downgraded to 22.3.3 and I’m not seeing the issue there, so it must only just be in the last minor version.

I’m currently on Ubuntu 20.04

Got the debug logs @ShadelessFox, thanks for the link. I’m not comfortable listing the entire log here, but I’d be happy to send you them elsewhere (desktop vs terminal usage).

I found the problem. DBeaver wasn’t able to locate the SSH socket on my client machine to access the agent because I don’ t use the normal ssh socket - I use GPG authentication (via gpg-agent) for SSH access, and the appropriate variable is set in my shell whereas it isn’t available to GUI applications

I had to append the SSH_AUTH_SOCK variable to the desktop file as follows:

--- /usr/share/applications/dbeaver.desktop	2021-03-02 11:22:21.000000000 +0100
+++ /home/chris/.local/share/applications/dbeaver.desktop	2021-03-10 18:00:12.485750751 +0100
@@ -6,7 +6,7 @@
 GenericName=UniversaL Database Manager
 Comment=Universal Database Manager and SQL Client.
 Path=/usr/share/dbeaver/
-Exec=/usr/share/dbeaver/dbeaver
+Exec=env SSH_AUTH_SOCK=/run/user/1000/gnupg/S.gpg-agent.ssh /usr/share/dbeaver/dbeaver
 Icon=/usr/share/dbeaver/dbeaver.png
 Categories=IDE;Development
 WMCLASS=DBeaver

SSH tunnel access used to work, so I’m not sure why I had to make this change.