08 Feb

Remote Port Forwarding using SSH Tunnel

If you want someone on the internet to access a service/port on your local system(and you have access to a remote server), you can use SSH Tunnel to do this.

Step 1: Configure the Remote Server

Edit the /etc/ssh/sshd_config file – you’ll need Root privileges for this. Make sure these values are set…

AllowTcpForwarding no
GatewayPorts yes

Once this is done, restart the SSH Server on the remote server using sudo service ssh restart

Step 2: Run this command on the system that should be accessed…



ssh -nNT -R 8080:localhost:80 binnyva@binnyva.com

Now, just point the browser to http://binnya.com:8080 and the browser will connect to localhost:80. You can change port numbers to access other services.

Source: A visual guide to SSH tunnels