Quick SOCKS proxying with ssh

14 Oct 2015 - mozilla

This is mostly relevant for *nix users. OpenSSH has a feature that lets you setup a SOCKS proxy pretty easily. This helps work around blocked sites without too much setup overhead.

Here’s what you do.

ssh -ND 10000 user@myserver.com

The -D flag specifies the local port that will be forwarded to the remote server. The -N flag makes sure that after the connection is made, no remote command is executed.

Now, open Firefox -> Preferences -> Advanced -> Network -> Settings. Select the “Manual proxy settings” option and enter localhost into SOCKS Host and 10000 into Port. Press OK. Now when you browse the internet on this instance of Firefox, the traffic should be routed through the server.

I’ve used if often to get around blocks and especially to get around local routing issues.

Remember, if your ssh connection breaks, your can’t visit any websites until you re-establish the connection. After you’re done, set the proxy settings back to the default (“Use System Proxy Settings”).