What you'll need:
- A rooted Android phone: Your phone needs to be rooted in order to be able to make connections through an SSH tunnel. If you haven't rooted your phone yet, and you're willing to take the leap, hit up our always up-to-date guide to Android rooting to get started.
- An SSH server: Ideally this would be rented from a web host online, but it could be any internet-connected computer with an SSH server running, including your home computer.
- SSH Tunnel (free from the Android Market)
Why use encryption at all? What's an SSH Tunnel?
Normally, you don't need to worry about encryption on your phone because you're already using your carrier's mobile data connection, which in and of itself is pretty secure already, if only because you're the only person using it. The problem arises when you connect to public Wi-Fi. On public Wi-Fi, anybody can listen in on everyone else's web traffic with the right tools, and in doing so, potentially gain access to things like your social networks, your email, or worse.
SSH Tunneling allows your phone to create a secure, encrypted connection to a server located far away from the public Wi-Fi, and run all your data through that connection (like a tunnel). The Wi-Fi connection you're using may not be secure, but when you're using an SSH tunnel, your data will be. See our previous guide to encrypt your web browsing session using this method on a computer for the desktop version of this guide.
Step One: Find or Set Up an SSH Server
The first thing you'll need to do in order to use an SSH tunnel, is to find a server to connect to from your phone.
Paying for an SSH Server
By far, the best option is to buy a monthly web host subscription. There are fast, reliable options to choose from for around $10/mo (or even cheaper). See our list of the five most popular reader-selected web hosts to get an idea of the pricing and options. Any web host will do, so long as it offers SSH access—this is the one thing it must have.
You can find free web hosts, but they tend to be extremely slow and unreliable. There are also "shell accounts," which are basically nothing but SSH accounts on a server; they're cheap, but you're really only saving a couple of dollars compared to the cheaper web hosts, and in my experience they're often not fast enough for our purposes.
You don't need to worry about buying a domain name for your server if you don't want to, since they come with what's called an "access domain." It's basically an ugly URL for your server (an example would be ve.tddlyfzr.vesrv.com), and it's all you need to connect with SSH.
Setting Up SSH on Your Home PC
If you don't feel like paying money for your SSH server, you've also got the option of setting up your own SSH server on your home PC, but it's got major pitfalls that make renting a web host—and spending the cost of two lattes—feel well worth it. When you tunnel through your home PC, the connection speed tends to be dismally slow (all the traffic is going through your home computer, so your speed will bottleneck with the speed of your upload bandwidth), not to mention the fact that the computer needs to be on and connected at all times. You'd also need to set up a service like DynDNS to assign a domain name to your PC and keep track of your home IP address, otherwise you wouldn't know where to connect to while out of the house.
Step Two: Set Up the SSH Tunnel App on Your Android
The free SSH Tunnel app does exactly what it sounds like: Creates the encrypted SSH tunnel between your phone and your SSH server, ensuring that all your internet usage is encrypted, even on open, public Wi-Fi networks. Setting it up is easy:
Once you have a server to connect to, simply enter your server's domain as the Host, then enter your SSH username, and your password. Check the boxes that read "Use socks proxy" and "Global Proxy," then flip the "Tunnel Switch" and it connects—dead simple. To make things even easier, the app also has options to reconnect automatically if the connection drops. Now, on all your connections (or just whenever you want to turn it on), all of your Android traffic will be secured, encrypted from prying eyes.