Using Firefox with a Putty SSH tunnel as a SOCKS proxy
The reason I wanted to do this one was viewing a site from an American IP address rather than an Australian. I tested this on my Bluehost account,
and it worked perfectly. Here are the instructions:
1. Work out how to connect to your server. You’ll need Putty (available at http://www.chiark.greenend.org.uk/~sgtatham/putty/)
– from the Session screen, put in your hostname, most likely port 22 for SSH, make sure SSH is selected as the connection type and click ‘Open’ at the bottom of the screen. If you can log in to that, then the SSH component works and you’re good to go for the
rest of this.
2. From Putty, go down to Connection > SSH > Tunnels. From this area, add in a source port (I’ve chosen 9870 but this can be any unused port), and choose ‘Dynamic’. Then click ‘Add’ and you’ll get an entry under “Forwarded Ports”:
3. Go back to Session and connect to SSH. You can save your session to load later rather than retyping the details:
4. Click “Open” and log onto your SSH session. You only need to log on with your credentials and get to a bash prompt.
5. Open Firefox, and go to the website http://whatismyip.com -
take note of your external IP address, because this should change once you’re tunnelling through SSH.
6. In Firefox, press the ‘alt’ key to bring up the top menu and go into Tools > Options. Under the “Advanced” area, go to the “Network” tab and in the “Connection” area click the “Settings” button.
Choose the “Manual proxy configuration” radio button, and under SOCKS Host enter “127.0.0.1″ and the port you entered into Putty (in my case it’s 9870). Make sure SOCKS v5 is selected.
8. Press OK twice to get back to the main view of the Firefox Browser. Try again to get to http://whatismyip.com -
if all is working, you’ll see a different IP address which is from the server you’re SSH’d to. If something isn’t configured correctly, you’ll more likely see a browser error like “The proxy server is refusing connections”.
That’s it! Handy for Australians to get access to different web content and pricing.
Update: BobGrrl on twitter has mentioned
another two options, free but requiring someone you know to help you at the other end. http://openvpn.net is
where you can get it, so a good free opensource solution pending you’re nice enough to someone in another country!
If you want to do this with BlueHost yourself, sign up here:
There’s a bunch of other stuff you get, not just proxy access
Update 19/11/2013: This has been tested under Windows 8.1 and worked perfectly. If you do any of the above settings wrong (like putting in 127.0.0.1 as your HTTP proxy rather than SOCKS Host) it probably won’t work. Also make sure your forwarded
port from the very first step is still there, if you close putty and re-open it may not remember those settings.