|
I'm usually not too paranoid about public surfing, but lately I've been doing some research on it, especially on a public wi-fi network, and now I'm a lot more paranoid.
I'm careful about physical security, having had one of my old Apple laptops seized by a ignorant employer. I had recently enabled the firmware level protection and password on wake-up as well. It really pissed of the IT guys that this puny Mac had better protection than their systems. Need less to say, they had nothing on me and gave the computer back.Since then, I've always made sure that I had the security settings active in case the computer left my possession.
Recently, I spent some time at a client facility where they had a guest wi-fi network, blazing 20mbps to boot. The only downside was a strict internet filter. It so happens that my web server happens to have a few adult related domains on it, and most filters just deny my ip address instead of the offending domains, so sometimes you wont even be able to see my non-adult domains, like this one. This presents a problem when I want to check my email, and the whole server is blocked.
So, off to Google to see what I can do. Basically I wanted to bypass the filter and shield my data from the clients IT department and anyone else on the network. One way to do this is called a Virtual Private Network, or VPN. This encrypts your data stream from your computer to another computer acting as the server, then on to the internet. Unfortunately, most VPN systems are pricey, and difficult to set up, additionally, the best VPNs are router based, requiring you to use that router on your network. As you've probably figured out, I don't like paying if there's a free option available, so I kept looking.
One of the things I learned in all this research is just how open a public wi-fi network is. If your sitting at a coffee shop using their free open wi-fi, that guy across the room may just be reading your mail over your shoulder. Or in my current situation, my clients IT department.
So, I'm looking for a free system, easily set up that will allow me to:
1. Bypass Internet filters
2. Protect my data while on a open network
Enter ssh tunnels, stage left!. Ssh stands for Secure Shell, and it is an incredibly powerful tool once you learn a bit about it. Ssh tunnels work just like a VPN in that you have an encrypted stream running from your computer to another computer on the internet, then on to wherever you are surfing. No hardware, just a little setting up. We'll get to that in just a bit, first the generic explanation.
Ssh is a more secure version of a terminal program. Terminal programs are used to communicate with a computer on the command line level, like DOS on an old PC, or UNIX/Linux. Every Mac running osX is based on Unix, so you have all kinds of powerful Unix functionality hidden in your Mac. Ssh implements encryption to make a terminal session secure. The program can be configured to encrypt any data stream on any port or channel between two computers running ssh. This encrypted stream is called a tunnel.
This tutorial assumes that you have two computers. One at home on an internet connection, and a laptop you keep with you. If you have only one, then you can get a free or paid shell account on another computer with ssh access. Google "ssh shell account".
All of the instructions below are given for Macintosh computers using an Airport wi-fi router. Most of the actual settings can easily be translated to Linux and Windows with a few tweaks. Windows users will have to install a ssh client to their machines. Most of these directions are a mashup of several different pages on the internet, most of which are listed at the end of this article.
This first part must be done while you have both computers in front of you. The computer you are using at a public wireless node is the mobile computer, and the home computer is the one staying home and acting as your server. Any commands that don't require your personal username or ip address can be copied and pasted in Terminal.
The first step is to generate encryption keys that will authenticate your laptop when connecting to the server.
Open Terminal on your mobile computer. (It's in the Utilities folder inside your applications folder)
type this command:
This creates a hidden folder in your user directory called ssh. If you get a message saying file exists, then the folder is already there. Next command:
ssh-keygen -t dsa -f ~/.ssh/id_dsa
This tells the program ssh-keygen to use(-t) dsa encryption to create a key pair named id_dsa and place them (-f) in the .ssh folder we created. You will be asked for a password at this point, it is up to you whether you provide one at this point. My suggestion is to use a blank password for this key as this key pair should only be used for authenticating the machine for an ssh session. If you enter a pass phrase for this key, you will be asked for it every time you use the key to authenticate an ssh session.
The next step is to move the public key from your laptop to the machine that will be staying home, I'm going to provide the command line steps to do this. If you want to use some other method like file sharing, and know how to view hidden folders, then use that method. You will need your home computer's ip address, you can find this in the Sharing preferences pane under personal file sharing.

Remember to press enter or return between lines:
cd .ssh
scp id_dsa.pub your_user_name@home-computer-ip-address:~/.ssh/id_dsa.pub
an example of what the second command should look like:
scp id_dsa.pub mike@127.0.0.1:~/.ssh/id_dsa.pub
Enter the password for the username your using.
First we are moving into (cd) the hidden ssh folder on the computer we're using, then the second command uses a secure file transfer program called scp to move the file called id_dsa.pub from the directory we're in to your home computers .ssh directory.
This next step involves logging into your home computer using the ssh program. If you haven't done this before, ssh will ask you if you want to trust this unknown server, you must type 'yes' for it to continue.
ssh your_user_name@home-computer-ip-address
Enter your password as in the last step. Then :
We have just logged into your home computer and moved to its hidden ssh folder. Next steps (pressing return between lines):
cat id_dsa.pub >> authorized_keys2
chmod 640 authorized_keys2
rm id_dsa.pub
exit
What have we done? First we added (cat) the contents of id_dsa.pub(your public key) to a file called authorized_keys2, creating the file if it doesn't exist. Then we changed the permissions of the file for security (chmod). We removed (rm) the public key file, and the exited the remote session(exit).
The next part will discuss setting up your home computer as a server and configuring your Airport firewall.
Reference Links:
http://www.macdevcenter.com/pub/a/mac/2004/07/09/inside_ssh_pt1.html
http://www.macdevcenter.com/pub/a/mac/2004/07/13/inside_ssh_pt2.html
http://www.macdevcenter.com/pub/a/mac/2004/07/20/inside_ssh_pt3.html
http://www.macdevcenter.com/pub/a/mac/2004/08/06/inside_ssh_pt4.html
http://www.astro.caltech.edu/~mbonati/WIRC/manual/DATARED/setting_up_no-password_ssh.html
To view the other parts of this tutorial, you must register for free using the register link under the login above. Select the free option and enter your information.
|