Reverse SSH tunnel

Reverse SSH tunnel

Reverse SSH tunnel 150 150 Roderick Derks

Have you ever wanted to ssh to your Linux box that sits behind NAT? Now you can with reverse SSH tunneling. These steps will show you the concept and how to set up reverse SSH tunneling. The reverse SSH tunneling should work fine with Unix like systems.

 

Let’s assume that Destination’s IP is 192.168.20.55 (your home-Linux box that you want to access). You want to access from a (Linux) client with an internet IP 138.47.99.99.

Destination (192.168.20.55) <- |NAT| <- Source (138.47.99.99)

  1. SSH from the destination to the source (with public ip) using command below:
    ssh -R 19999:localhost:22 sourceuser@138.47.99.99
    * port 19999 can be any unused port on the source’s side
     
  2. Now you can SSH from source to destination through SSH tunneling:
    ssh localhost -p 19999

Roderick Derks

Liefhebber van fietsen, van het oplossen van IT puzzels, en van het delen van informatie om anderen te helpen.

All stories by:Roderick Derks

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Your Name (required)

Your Email (required)

Subject

Your Message

Your Name (required)

Your Email (required)

Subject

Your Message