Wednesday, April 4, 2012

Proxy Firefox through a SSH tunnel

Have you ever wanted to visit sites during the day from a location that denied access to those sites? What you need is the ability to create a secure and encrypted ssh connection to tunnel your browser traffic through. If you have access to a remote machine by way of ssh, you can set up Firefox to visit these sites.

The following method is only tested on Windows XP, with cygwin installed.

LOCAL_PORT: localhost port for ssh tunnel
SERVER_NAME: remote machine

1. set up firefox proxy
  • preferences --> advanced --> network --> settings
  • choose SOCKS v5
  • manual proxy configurations:
  • SOCKS 
    • Host:
    • No Proxy for: localhost,
  • leave the rest of entries BLANK
2. set up firefox DNS
  • open "about:config" page in Firefox
  • search "network.proxy.socks_remote_dns", set the value to "true"
3. establish ssh tunnel
   ssh -C2qTnN -D LOCAL_PORT username@SERVER_NAME