Tunnel web traffic with OpenSSH
by jz on 2012-12-18You can create an encrypted tunnel with OpenSSH that will route all traffic through the remote server.
This is handy if you are using a machine that sits behind a firewall that filters certain sites.
1. Install OpenSSH on the remote server. In Debian/Ubuntu/Mint you can do this with the following command:
sudo apt-get install openssh-server
2. At the client end (your computer) run the following command:
ssh -C -f -N -D 127.0.0.1:88 [user]@[openssh-server]
Where [user] is your username and the [openssh-server] is the IP address or domain of the remote server.
E.g., jz@jz.bz
3. Set your web browser to use the tunnel you have set up by doing the following:
In the Firefox “Preferences” menu choose “Advanced” followed by “Network” and then click on “Settings”. Click on “Manual proxy configuration” and fill in the “SOCKS Host” field with 127.0.0.1 and set the port to 88.

4. Finally in Firefox you will need to type about:config into the address bar and change the value of “network.proxy.socks_remote_dns” to “true”. This is not necessary in Chromium because it will automatically resolve DNS requests through the remote server.
5. Browse the web and all the traffic will appear to be transmitted to the client encrypted, any site you visit will think the SSH server is the client allowing you to potentially bypass geographic restrictions if your server is in the right country.



