DEV Community

Discussion on: SSH Tunneling via a Jump Host

Collapse
 
ramnikov profile image
Andrey Ramnikov

I am using windows server.
How can i configure this command on Putty/Kitty?

Collapse
 
claudiohigashi profile image
Claudio Higashi • Edited

In case of Windows, it would be ideal if you install Cygwin or WSL (Windows Subsystem for Linux, available on Windows 10). You are going to find a way to install ssh command on these two options.

If you really wanna use Putty, you can still do it, but it will be a bit more complicated as it will require you to explicitly open two distinct SSH sessions: one via Putty and the other via ssh command on the jumphost server.

For the sake of simplicity, I'm gonna use the same example used in the article.

1. Your Putty SSH session

You will need to configure an SSH session to the jumphost server

Putty

And set up a tunnel, mapping your local port 1521 to the port 1521 of the jumphost server

Putty

Use this Putty session to log in to the jumphost server with user myusr

2. The second SSH session (via command line)

Once you are connected to jumphost server, you can now create the second SSH session to connect to the appserver and create a tunnel from the jumphost's local port 1521 to the port 1521 of the dbserver machine.

ssh -v -N appusr@appserver -L 1521:dbserver:1521
Enter fullscreen mode Exit fullscreen mode

You will be prompted to provide the appusr's password.

3. And it's done!

Now, you are ready to connect to the "behind-the-jumphost" database server via port 1521 of localhost.

Oh my gosh! This response seems to be almost as extensive as the original post :-p

Take care and be healthy!

Collapse
 
ramnikov profile image
Andrey Ramnikov

Many thanks for your advice and your time