« Twitter Spam | Adding Google Analytics to Sphinx Docs »
SSH Tunneling has become an invaluable tool that I probably use more than I should. I love tunneling, and use it all the time. This will be a quick tutorial on how to use the SOCKS proxy ability of SSH to allow you to tunnel your HTTP traffic through a remote server.
This is useful when you're on a connection that has a silly filter on it (school or library). Since it's a unsupported characters, or include a non-local or incorrectly linked interwiki prefix. You may be able to locate the desired page by searching for its name (with interwiki prefix, if any) in the search box.
Possible causes are:
If you tried to access a non-local interwiki page, you may be able to access that page by clicking the "article" tab on this page.
> proxy, it is useful for tunneling other things as well (like IM). It is also useful when browsing on public wifi or anywhere that you can't trust the network connection you're on, since it encrypts all the data that is sent over it.The command to tunnel in SSH is really simple. You simply do: ssh -ND localhost:5555 example.com to tunnel traffic through example.com. This is a nice one off, but I actually have the configuration in my ssh config. To do that, in your ~/.ssh/config, you need to put in the settings you want your proxy to have.
Host tunnel
Hostname example.com
DynamicForward localhost:5555
This allows me to simply do ssh -N tunnel, and it will setup a proxy. This is basically turning my local port 5555 into a proxy that goes through the remote host. It is encrypted from my network to the remote network, which is really nice. The -N flag is used so that it doesn't create a shell on the other end, and simply creates the proxy connection.
In firefox, you need to go into your Preferences > Advanced > Network > Connection > Settings. This is where your proxy settings live. Go down the the SOCKS host, and set it to localhost, with the port you set up above, 5555 in this case. It should look something like this:

I use the Quickproxy extension to easily turn my proxy settings on and off. It puts a small button on your bottom status bar in Firefox, and clicking it turns your proxy on and off.
Now you simply flip the switch on your QuickProxy, and you are surfing through an encrypted connection. To check if it's working, I use http://whatismyip.com to check my remote IP. If it changes between the proxy being on and off, you know the proxy is working.
This is a really easy way to simply create a two click encrypted proxy. Hope this is helpful, and I'd be curious if people have other tips and tricks in this regard.
Posted at 4:45 p.m. on March 21, 2009
Comments: 2
Building a Django App Server with Chef: Part 2
Building a Django App Server with Chef: Part 1
Building a Django App Server with Chef: Part 4
Welcome to the home of Eric Holscher on the web. I talk about software development, mostly in the realm of Django. I am interested in the real time web, testing, mobile apps, and other things.
Why Read the Docs matters
2 weeks, 1 day ago (Comments: 7)
Read the Docs Update
10 months ago (Comments: 2)
Using Reviewboard with Git
1 year ago (Comments: 0)
Read the Docs Updates
1 year ago (Comments: 1)
Handling Django Settings Files
1 year ago (Comments: 12)
Required Reading
1 year, 2 months ago (Comments: 0)
Using Haystack to index non-database content
1 year, 2 months ago (Comments: 4)
Correct commands to check out and update VCS repos
1 year, 2 months ago (Comments: 0)
Site upgrades
1 year, 2 months ago (Comments: 0)
Building a Django App Server with Chef: Part 4
1 year, 2 months ago (Comments: 1)
Setting up Django and mod_wsgi
Building a Django App Server with Chef: Part 1
Screencast: Django Command Extensions
Big list of Django tips (and some python tips too)
Handling Django Settings Files
Lessons Learned From The Dash: Easy Django Deployment
Large Problems in Django, Mostly Solved: Delayed Execution
Building a Django App Server with Chef: Part 2


Comments
1 Chris Lasher says...
I really like doing this trick, too. GNOME Desktop users can also configure this to be system-wide by going to System -> Preferences -> Network Proxy -> Proxy Configuration. Select "Manual proxy configuration"; set "Socks host" to "localhost" and the port to your selected port, "5555" in your example. If you do this, you won't have to manually configure Firefox--by default it uses the system proxy. Now many (all?) of your programs will route through the host you connected to.
Posted at 12:20 a.m. on March 22, 2009
2 Steve Pinkham says...
Note that Firefox doesn't tunnel DNS through the proxy by default, you need to set Network.proxy.socks_remote_dns to true in about:config to truly be tunneling everything through, which is probably the behavior you want. See Mozilla docs and this tutorial for more info.
Posted at 2:54 a.m. on March 22, 2009