question-mark
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.

SSH Tunnel to server thru a jump server

See original GitHub issue

Hi,

I have setup where i have jump server in between So it is like: Client --SSH–> Jump Server --SSH–> Server In my mac i have used ProxyCommand in .ssh/config to create a ssh tunnel to the server Thus my config file has server defined as:

Host jump
        HostName <JUMP IP>
        User dhaval
        IdentityFile <PATH TO KEY>
Host app
        HostName <APPIP>
        User dhaval
        IdentityFile <PATH TO KEY>
        ForwardAgent yes
        ProxyCommand ssh jump nc %h %p 2> /dev/null

Thus I am able to do a ssh to server using command ssh app

Now the queries:

  1. I am not able to use app as host name in Dbeaver, although it is mentioned in .ssh/config
  2. When I try IP of jump server and test ssh tunnel in DBeaver it goes thru but if I use IP of server it doesn’t go thru

Any pointers will be helpful

~DKS

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:22
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
stabylocommented, Mar 8, 2021

For those remaining blocked by this approach : Client --SSH–> Jump Server --SSH–> Server

The following ssh command in terminal allowed me to forward local port 1234 to Server port 5432 ssh -L 1234:localhost:5432 [user]@[Jump Server Address] [user]@[Server Address]

Then i was able to connect directly with dBeaver on port 1234 (without using SSH tunnel configuration)

But i would appreciate to be able to do that without using terminal and stay in dBeaver. #7164 didn’t solved it for this.

0reactions
sfog17commented, Feb 20, 2021

I have a similar problem The work around with “Shell Commands in connections settings” doesn’t work for me

The only solution I found so far is to:

  • Connect to the jumphost (ssh jumpuser@jumphost)
  • From the jumphost, local forward the port (ssh -f -N user@target -L portJump:localhost:portDB)
  • Then go back to my local machine and I can connect via DBeaver (SSH tab, host: jumphost, user: jumpuser, port: portJump)
Read more comments on GitHub >

github_iconTop Results From Across the Web

SSH Tunneling via a Jump Host - DEV Community ‍ ‍
Once you are connected to jumphost server, you can now create the second SSH session to connect to the appserver and create a...
Read more >
Tutorial for setting up an SSH Jump Server - Teleport
An SSH jump server is a regular Linux server, accessible from the Internet, which is used as a gateway to access other Linux...
Read more >
How to Access a Remote Server Using a SSH Jump Host
The simplest way to connect to a target server via a jump host is using the -A and -J flags from the command...
Read more >
ssh - Securely tunnel port through intermediate host
I have to jump over a single host to then hop to my actual work machine. sittinghere will be my local home machine;...
Read more >
SSH Tunneling: Client Command & Server Configuration
Tunneling sessions and file transfers through jump servers. Connecting to a service on an internal network from the outside. Connecting to a remote...
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 Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found