Recently I was on public WI-FI in The Aviator and I wanted to encrypt my traffic to prevent anyone else from sniffing it.


The simplest way to achieve this was with a multi-protocol SSH tunnel.

The concept is that SSH can be a ‘encrypted wrapper’ around your other TCP traffic, eg HTTP or IMAP. You open a SSH session between your machine and another (outside of the public WI-FI / Firewall etc) and funnel your traffic down and up it, thus the ‘tunnel’.

Not only does it mean that normal traffic is now encrypted but you can also use it to bypass restrictions in the local network.

In a terminal you’ll need to use the following line to open the tunnel and put it in the background:

ssh -fND localhost:2080 user@remotehost

 Create Multi Purpose SSH Tunnel

Terminal and SSH arguments to create tunnel

The above will mean that now any program I set to use localhost:2080 as a SOCKS proxy will tunnel the requests to the remote host and back again, keeping the whole thing nicely encrypted.

In Firefox and Thunderbird it’s quite easy to set up, it’s just in the Network section of the program’s preferences:

 Create Multi Purpose SSH Tunnel

Firefox Network Settings

 Create Multi Purpose SSH Tunnel

Enable the SOCKS proxy