Revisiting SSH Tunneling Tricks

SSH tunneling is so useful that I find myself revisiting it again. This post helped me to get started. I would add the -f option to run the command in the background. 5126 is the port I use on my own machine once the tunnel is established.

ssh -f -N -L 5126:TARGET_SERVER:22 USER@GATEWAY_SERVER

Once the tunnel is established, I could establish a ssh connection using the tunnel. In this case I also enabled X forwarding.

ssh -X -p5126 USER@localhost

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s