fredag 3. oktober 2014

HOWTO use SSH and PuTTY as SOCKS proxy server for secure surfing on public wifi

I've been looking around for different solutions to secure my wlan connection when traveling, lots of hotels are only using open wifi networks and that's a BIG security flaw.
This solution may also work for bypassing webfilters a work, if you want to surf on websites not allowed by your employer this will help you. (but I'm not liable for any damage you cause your employers network/computers or if you get fired for doing this :) ).

After trying several solutions I came across a blogpost about using a SSH connection as a secure proxy server for whatever software you're using. But I had problems getting it to work, I found only poor guides on how to do it. So here I will try to make a better one.

I'm running windows 8 on my laptop so I will be demonstrating this using PuTTYwhich is a SSH client for Windows. Google it.

The only thing you need for this to work is access to a SSH server, this can be your webhost, home server or whatever.


  • First you need to download PyTTY. Download
  • When you start PyTTY you will see the window below, here you fill in your SSH server hostname, port and choose SSH. (shown with red circles)


  • When you have entered your hostname and port you click on SSH on the category list on the left, and then choose Tunnels.
  • A new configuration page will come into view, identical to the image below. Fill in the following information:
    Source Port (the port you want the proxy to run on, normally 8080)
    Destination (it's the same hostname and port as on the first config page but with a colon between hostname and port number)
    Choose Dynamic just below destination 




  • Click Add to add the configuration for this connection. You should now see a number in the text field above. See image below.



  • You're now finished with your configuration, click open to start the SSH session and log in normally using your username and password at the SSH server.


After finishing the PyTTY configuration you'll also need to add the Proxy server to your browser, In firefox, go to settings, network and choose connection settings.
Here you'll choose manual settings and in the SOCKS field you write localhost and in port you write 8080 (same we set in the PuTTY configuration earlier).
It does not matter if the SOCKS setting is on SOCKS4 or SOCKS5.
Click OK and you're done.

You are now surfing with the SSH serves IP adress as the visible one, go to whatismyip.com to verify your public IP adress.