Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Launch ssh command in before connect not working

See original GitHub issue

Hi, If I launch this command in shell (not in DBeaver) ssh -L 3133:ip:5433 user@server -N And I click on Test connection in DBeaver, it works.

If I kill my command in shell, add in DBeaver same command in “Before Connect” and click on Test connection, it not works. I have this error

Connection to refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections. Connexion refusée (Connection refused)

Version of DBeaver I use : dbeaver-ce_4.0.7_amd64.deb

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

davideasafcommented, Oct 30, 2021

Environment: macOS Other Details:

  • Normally in my terminal i use OH MY ZSH
  • I wrote a script to call from “Shell Commands” in Dbeaver
  • I called that .sh command via: /bin/bash


I had a lot of issues trying to leverage commands within the shell executor that DBeaver started. It all came down to Dbeaver starting a shell execution with a different $PATH than my usual.

standard PATH within running script: /usr/bin:/bin:/usr/sbin:/sbin

serge-ridercommented, May 20, 2017

Probably this happens because DBeaver doesn’t make any pause before ssh command execute and connection attempt (so SSH doesn’t have a chance to establish tunnel before db connect). I’ve added extra config parameters: default

Try this in 4.1.0.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SSH config file - Run command before connection
ssh /config file. I have tried with options "ProxyCommand" and "LocalCommand" but it doesn't work. ProxyCommand: seems it run the command, ...
Read more >
How do I run a local command before starting SSH connection ...
For OpenSSH you can specify a LocalCommand in your ssh config ( ~/.ssh/config ). But for that to work you also need the...
Read more >
SSH client: port knocking (execute command before connecting)
Install the knock program by running sudo apt-get install knockd · Make a script in ~/bin to establish the SSH connection for the...
Read more >
How To Run / Execute Command Using SSH - nixCraft
Describes how to run or execute a command using SSH with various command-line techniques on Linux, macOS, BSD, and Unix.
Read more >
Can I execute some commands when starting ssh session ...
Neither -t option for ssh , nor -l option for bash will lead to login shell on their ... not bash 's -...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found