Monday, 25 September 2006

SSH as a SOCKS proxy revisited

A while ago I had tried to use SSH as a web proxy and didn't have any success in getting it to actually work. I was worried that maybe this was a NAT-to-NAT complication or something of the sort but no, it was just a client configuration problem. It turns out the trick is to just set the SOCKS settings in Firefox rather then the HTTP proxy. Firefox will choose the HTTP proxy first or maybe I just don't understand the difference, but here's how it works for me:

ssh -D port host

e.g.
ssh -D 3125 siona.nibble.bz


Then configure Firefox (Edit - Preferences - Connection Settings) with a SOCKS proxy of localhost, port 3125 like this:



The best test is to go to What Is My IP? and refresh the page with the proxy disabled/enabled and verify the IP address changes.

Now for shits and giggles, you use -f and -N with SSH to background the ssh process (the -f) without running any remote command (the -N) like this:

ssh -fN -D 3125 siona.nibble.bz


This will leave your SOCKS proxy in the background so you can close your terminal and still surf through the proxy.

Hooray for bypassing crappy firewalls and HTTP proxies!

No comments:

Post a Comment

Popular Posts