SSH: The ultimate firewall poker
I’m in a hotel tonight and my internet connection is slow. My friend sent me some cool YouTube videos that I wanted to check out and I was wondering if the hotel was limiting the bandwidth of YouTube? A few days ago a friend of mine and I were talking about how to bypass corporate firewalls where companies block facebook/gmail/twitter access. The way to check the YouTube problem and to bypass corporate firewalls can be done using the same solution: SSH.
SSH encrypts data in and out of networks. It is the ultimate firwall poker. If you have SSH capabilities on at least one server on the internet and you can get to it then you can let any traffic in and out of a network. Traffic is all encrypted so no sniffers know anything other than the fact that you have a connection from your machine (inside the corporate firewall / hotel wireless) on port 22 to some remote server that you have access to outside of the network you are on.
So here’s a quick test to see if YouTube was being throttled on this network, provided you have a Mac. I’m doing this on OSX Lion.
1. SSH to some remote internet server. I have one, so I open a port to it:
ssh -D 2011 email@example.com
This essentially turns your ssh connection into a SOCKS server.
2. Open chrome and navigate to:
From here select ‘Change Proxy Settings’ and your Mac settings will come up. Change the Socks settings as shown below:
That’s it. Now you can visit http://whatismyip.com and see that the IP address changed. You can also go to google maps and it will think you are in the city where the server is getting its network access from.
So, what about the YouTube video? Seemed to be a bit better actually… but was hard to tell. Probably was the same…
The other cool thing about this is how if you were in an airport then you can skip annoying adds that come on your web browser then this is how you could do it.
I’ve written in the past about all the cool tunnels you could make with SSH. (See Trick 5 and Trick 6)
The point is: There are ways around corporate policies that block you from checking sites you like, and ways to stop service providers from limiting your bandwidth based on the sites you visit. Now obviously, you have to trust that the machine you SSH into allows you access to all that. But that server is your choice!