SSH Server as Secure SOCKS Proxy

With common SSH tools, it is possible to create a dynamic port forward to an SSH server that can be used as a SOCKS compatible proxy. This can allow a user to securely tunnel traffic through their SSH server.

Putty (Windows)

Putty is the standard SSH client for Windows users, and can be configured to established the dynamic port forwards that can be used as a proxy. To do so on an active connection, right click on the title bar and select 'Change Settings...'., then navigate to Connection > SSH > Tunnels.

From here, the dynamic port forward is created by specifiying a source port (any unused port, generally above 1025) and selecting a 'Dynamic' forward type, and then selecting 'Add' and 'Apply'.  The 'Destination' field can remain blank.

putty_proxy

ssh (Linux/OSX)

For Linux and Mac OSX users, the 'ssh' command can be used to create the dynamic port forward upon connection using the '-D' command switch.

ssh -D port_number user@host

Your local computer will now be listening on the specified port number.

Using the Proxy

Any program which supports the use of a SOCKS proxy server can now be configured to use a proxy on host '127.0.0.1' and the specified port.

Your web browser for example, can be easily configured to now connect through this proxy. With Firefox, this is set under Tools > Options > Advanced > Network > Connection > Settings....

firefox_proxy

If you now visit a site such as whatismyip.com, you'll see that your connection is now being forwarded through the IP of your server.