Proxy Firefox through a SSH tunnel

This is a tip I suppose everyone can use sometime, for instance, to watch those pesky US-only websites from outside the US or just when privacy is wanted on say, a public network.

The way this works is to make the SSH client on your computer work like a SOCKS5 server, allowing you to tunnel all of your blowsers traffic through a SSH server of your choice and onto the internet. For this to work, you need a computer running a SSH server somewhere, that you are able to connect to from the network you are on.

Alright, I think the teory is in place now, let's get cracking! First, you start a SSH client in Master mode, to listen for connections on port 8080 and redirect all of that traffic to the ssh server of your choice:

ssh -C2qTnN -D 8080 user@remote_machine.com

That's it! Now you only need to configure Firefox to use your newly created socks server:

Go to Edit->Preferences->Advanced, click on the Network tab and click Settings. Set your settings like this:

Click Ok. Type in in your addressbar (or click the link if using firefox). Use the filter to find this value: network.proxy.socks_remote_dns and change the value to true by doubleclicking on the value. This will make firefox send any DNS queries through the SSH tunnel as well, making sure nothing gets leaked onto the network you are using.

That's it. To try it out, go to myIP.dk to check out which IP address your traffic is comming from.

Do you use this method yourself? Do you care much about security at all while browsing?


Written by Jannich Brendle man 17 januar 2011 In How to

tags: debiansecurityubuntu

Related posts

social