How to Create a Proxy Server Using SSH

SSH is a powerful tool I have known how to use since I started using Linux from secure shell to tunneling, down to port forwarding etc. One of the interesting features I have come across is creating a proxy server using SSH.

This side of the world I’m in is limited at some point to access data. When I need a one time access to a foreign IP address to access these data, I don’t have to buy a monthly VPN I might use just once or twice a month. So I figured out SSH can create a proxy server. Most Linux systems come with SSH pre-installed, same goes for all Linux hosting accounts. If they are not accessible, then you have to contact your web hosting admin.

Creating SOCK5 Proxy Server

We are going to create this proxy and bind it to 127.0.0.1:8080, assuming my web host IP address is 192.168.0.20 and my username is donjajo. SSH creates a SOCKv4 and SOCKv5 Proxy at the moment, so this is what we are going to use. Good thing our browsers support it.

SSH (Linux & Mac)

Open up your command line and run:

$ ssh -D 127.0.0.1:8080 donjajo@192.168.0.20

Yes, that easy, then connect. 🙂

PuTTY (Windows)

Download PuTTY and configure as the screenshot below

The above configuration yields same result as Linux’s. This binds the remote IP to the local PC IP, when a request is made to that port it is forwarded under a secure channel to the remote host. You can change the port to your desired, this will require admin/root access.

Using The Proxy

It is basically the same way you use other proxies, only if they support SOCK proxy method. This is how to configure this on FireFox:

This is all and should be working immediately when there is a successful authentication. Please note this will affect your web hosting bandwidth too if you have a metered one.

Comments

3 responses to “How to Create a Proxy Server Using SSH”