How to do port forwarding through SSH tunneling on Ubuntu 12.04
The place I was staying in last night requires me to register my devices’ MAC addresses with their access points to be given access. I couldn’t help but think that they could be tracking my online activities with this.
Of course, the reason they’re probably doing MAC Address Filtering is to make it harder for people not staying in the hotel to piggyback off their connection. Most places will just have a Wi-Fi password. But that password can be given to anyone and it will inconvenience the customers if they keep changing the passwords. Maybe they’re doing this for the best interest of their guests, so people not staying there won’t get the free Wi-Fi and slow it down for the customers.
The solution is to use port forwarding via SSH tunneling. The idea is to route all your traffic to a remote server, so if someone’s sniffing on my packets, all he’ll be able to find out is the IP address of the remote server I’m connected to and all data being transmitted will be encrypted. All traffic will have to go through the remote SSH server.
On Windows, I had this setup as a simple script that uses PuTTY to connect to my Rackspace server. But since I switched to Ubuntu, I can just use the built-in SSH client to connect.
Here’s the command:
ssh –C –D 1080 my.server.com
The –C option is optional. This option enables compression to speed up the transfer when transferring text-based information such as when web browsing, but slower when transferring binary data such as when downloading files.
The –D option is for dynamic port forwarding (SOCKS).
1080 is the standard SOCKS port. You can change this to something else.
Configuring Google Chrome to Use the SOCKS Proxy
In Google Chrome Settings, search for proxy and click Change Proxy Settings.
Select Network proxy, set Method to Manual, enter localhost for Socks Host, and enter 1080 for the port number (or whichever port number you chose). Click Apply system wide.
Go to http://www.showmemyip.com to see if the proxy works. It should display the IP address of the remote SSH server.
Tags: howto, tech, networking