Using ssh as a proxy or encrypted tunnel to browse the web can sometimes be necessary:
- When you’re at some public place but need to login securely to your work place.
- When local access restrictions make life really difficult.
I use SSH for the security reasons. I want to make sure that my security and login information will remain secure:
ssh -D 12345 myuser@remote_ssh_server
Replace myuser with your user account and remote_ssh_server with the IP or Hostname of your server.
The above command will do all, but if you want to add more options, you can add other options like:-
-D 12345: This does the dynamic stuff and makes it behave as a SOCKS server. -f : This will fork the process into the background after you type your password (for Linux only, on windows skip that). -C : Turns on compression. -q : Quiet mode. Since this is just a tunnel we can make it quiet (for Linux only, on windows skip that). -N : Tells it no commands will be sent. (the -f will complain if we don’t specify this)
Next, set up your browser to use the proxy server. Most browsers include proxy support. For Firefox, go to Edit→Preferences→Advanced→Network→Settings, and specify that you want to use a Manual Proxy, localhost, port 12345 and SOCKS v5 (although OpenSSH supports both versions 4 and 5).
HTTP Proxy (The first input). Must be left blank and add this config to SOCKS only.
Now your browser is using a secure tunnel to your remote SSH server, Enjoy