Firefox Socket Proxy via SSH

An SSH tunnel comes handy when you need to access a local area network from outside (IMO more so than a VPN for this purpose).

Open up a Tunnel

In the first place, you need a machine inside the firewall that you have SSH access to. Create a tunnel using

$ ssh -D 2333 -f -C -q -N user@host


  • -D tells SSH that we want a SOCKS tunnel on the specified port number (you can choose a number between 1025-65536),
  • -f forks the process to the background,
  • -C compresses the data before sending it,
  • -q uses quiet mode,
  • -N tells SSH that no command will be sent once the tunnel is up.

Reroute Firefox Traffic

Go to Firefox’s Preferences (about:preferences), under the General tab.

At the bottom there is the “Network Proxy” section. In there select “Manual proxy configuration” and at the “SOCKS Host” line enter localhost and the port number used by the tunnel.

After confirming changes, there is no need to restart anything. Just open up a new tab and new proxy settings should take effect.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.