Try Vultr Today with $50 Free On Us!

Get Started Now

Reverse SSH Tunneling

Published on: Mon, Feb 22, 2016 at 8:30 am EST

It is a common practice among Internet Service Providers to block the majority of, if not all incoming ports for their home subscribers — making it impossible to remotely connect to your home computer via HTTP, SSH, FTP, etc.

In this tutorial we will covering how to bypass these restrictions using a technique called Rerverse SSH Tunneling.

Note: This tutorial assumes you are using Ubuntu. The steps however are expected to work for other Linux distribution.


  • An Ubuntu server instance.
  • A SSH Client on your local machine.

Step 1: Configuring SSH daemon on your server:

By default, SSH daemon is only listening on, so we won’t be able to access to our forwarded ports from outside. To get it listen on the interface connected to Internet we must enable GatewayPorts option in SSH server's configuration.

Open /etc/ssh/sshd_config using your favorite text editor.

nano /etc/ssh/sshd_config

Then add GatewayPorts yes at the bottom of the file.

After saving the file, restart the SSH daemon:

service ssh restart

Step 2: Tunneling:

If your home computer runs Linux, you’ll need to use the ssh command as follows:

ssh -R [Port to forward to on your VPS]:localhost:[Port to forward on your local machine] [VPS IP]

Or if you have installed Microsoft Windows on your machine then you have to install plink and connect as shows below:

plink -R [Port to forward to on your VPS]:localhost:[Port to forward on your local machine] [VPS IP]

In this example, we’re forwarding port 19132 which is open on your at-home machine to port 80 on your remote server (assuming your server’s IP Address is

ssh -R 80:localhost:19132

This will allow you to access your at-home machine from a remote location by connecting to

This concludes our tutorial. Thank you for reading.

Want to contribute ?

You could earn up to $300 by adding new articles!

Get started in the SSD Cloud!