Similar to my previous post about forwarding browser traffic through an SSH tunnel, this time I’ll show you how to do it on Android even without root access. Please note that while I’m sure there are a few ways to accomplish this, the following is just one way that has worked for me. I’m also assuming that you already have an SSH server to tunnel your traffic through.
Step 1: Install SSH Tunnel
The first thing you’ll want to do is install an application that will actually create the SSH tunnel for you. One such application is the aptly named SSH Tunnel which can be found on the Google Play Store here.
Step 2: Configure SSH Tunnel
Next you’ll want to launch the application and configure it.
- Set the Host address (either a real domain name, dynamic DNS redirector or IP address of your SSH server) and port to connect on.
- You’ll also want to configure the User and Password / Passphrase.
- Check the box that says Use socks proxy.
- Configure the Local Port that you’ll connect to your tunnel on (perhaps 1984 for the paranoid?)
- I would recommend checking Auto Reconnect as well, especially if you are on a really poor WiFi connection like at a hotel or something.
- Finally check Enable DNS Proxy.
Step 3: Connect SSH Tunnel
To start the SSH tunnel simply check the box that says Tunnel Switch.
Step 4: Install Firefox
While you may have a preference for Google Chrome, Firefox is the browser I’m going to recommend setting up the tunnel with. Additionally this way if you do normally use Chrome you can simply leave Firefox configured to always use the SSH tunnel and only switch to it when you want the additional privacy. Firefox can be found on the Google Play store here.
Step 5: Configure Firefox to use SSH Tunnel
In order to make Firefox connect via the SSH tunnel you’ll need to modify some settings. Once you are finished the browser will only work if the SSH tunnel is connected.
- In the Firefox address bar browse to “about:config” with no quotes.
- In the page that loads search and modify the following values:
- Change to “127.0.0.1” with no quotes
- Change to the SSH Tunnel Local Port set above (1984?)
- Change to true
- Change to 5
- Change to 1
Step 6: Test and browse normally
Now that you have configured the above you should be able to browse via the tunnel. How can you check if it is working? Simply turn off the SSH Tunnel and try browsing – you should get an error message. Or if you are on a different WiFi you could try using a service to find your IP address and make sure it is different from where you are. For example if you configured Firefox to work via the SSH tunnel but left Chrome as is then visiting a site like http://www.whatismyip.com/ should show different information in each browser.