Firefox SOCKS proxying with SSH to get unhindered internet access

This is a short guide how to get unhindered Internet access (HTTP) in a country or network which limits internet connectivity. You need access to OpenSSH server somewhere outside the network. These instructions were tested on OSX (Snow Leopard), but should work on other operating systems too.

SOCKS proxy is built into OpenSSH terminal connection software. OSX comes with ssh client.

Open Applications -> Utilities -> Terminal (on OSX) and type the command

ssh -D 8080

Login to the SSH and leave the connection open. If ssh complains about binding the port 8080, then you might have another ssh already running. Also the SSH server might prohibit using itself as a proxy.

Now, In Firefox (Firefox 4 or later) go Preferences -> Advanced -> Network -> Settings

Turn on Manual proxy configuration.

Socks hosts: localhost

Port: 8080

Hit ok. If you lose network connectivity just restore proxy settings back to the automatic.

Go to and see that it gives you the IP address of the SSH server, not your local internet connection as the result.

Firefox will start complain about proxy error when SSH connection is terminated.

If you also want to use non-proxied connection (faster) simulateneously, just open another browser e.g. Safari.

1. More info

\"\" Subscribe to RSS feed Follow me on Twitter Follow me on Facebook Follow me Google+

2 thoughts on “Firefox SOCKS proxying with SSH to get unhindered internet access

  1. Pingback: Set-up PPTP virtual private network (VPN) server on Ubuntu Linux | Open Source Hacker

  2. For SOCKS5 proxied git you can do the following on OSX (netcat from Macports needed).
    Assuming SSH SOCKS5 running in localhost:8090.

    export GIT_PROXY_COMMAND=/bin/proxy-wrapper

    sudo -i
    cat > /bin/proxy-wrapper
    nc -xlocalhost:8090 -X5 $*
    # CTRL+D

    sudo chmod a+x /bin/proxy-wrapper

    After this git will use SOCKS5 proxy for git:// protocol.

    Works on GitHub.

Leave a Reply

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