Zack Scholl

How to tunnel with SSH

 / #tutorial 

A quick tip for using SSH to tunnel into your local network for easily binding remote ports on your local computer.

Here’s a simple trick for SSH tunneling, so that you can bind a local port to one on a server that you have SSH access.

What for?” you ask? Let’s say your at work and you need to add port-forwarding to your home. In this case you need to remotely access on your LAN network at home. To make your LAN network available at at your work network, simply make a SSH tunnel.

You can make an SSH tunnel to capture port 80 on your remote machine and show it on port 9000 of your local machine:

$ ssh -L 9000:localhost:80 user@yourhomeaddress

Pretty cool!

You can also use ssh to tunnel into sites that are blocked. Let say you are at work and is being blocked. To get around this we can create a tunnel through a server which isn’t in our network and thus can access Imgur.

$ ssh -L user@yourhomeaddress