Thursday, August 15, 2013

How to Install and Use Hamachi on Ubuntu Server 10.04 LTS

Logmein.com is a great service for anyone who wants to access their computer securely from anywhere on the internet. Logmein offers both free and paid versions of their services which include among other things, remote computer access, remote backup services and, the topic of this article, free vpn software called Hamachi. 

Hamachi is easy to use and allows you to join several computers to a virtual private network and share resources across the internet. For my purposes, I use Hamachi as a quick and easy way to enable remote sessions across my private network which spans several households, and includes a couple of linux servers and a dozen or so Windows and Mac boxes.
This walk-though will get Hamachi up and running on Linux Server 10.04 from the command line. There may be a way do do it using a gui, but since I run a headless machine, this method works well for me. 


To get things started, first download the latest linux client software which can be found here: LogMeIn Hamachi Beta Labs Site Obviously I'll be using the latest DEB package, but you may need a different flavor. Hamachi comes in both 32 and 64-bit versions, be sure to download the appropriate one for your system.


Download 32-bit version:

$ wget https://secure.logmein.com/labs/logmein-hamachi_2.0.1.15-1_i386.deb
Download 64-bit version:

$ wget https://secure.logmein.com/labs/logmein-hamachi_2.0.1.15-1_amd64.deb
Install the package. Note if you have an old version of Hamachi already installed, you should uninstall it before you move on.

Install 32-bit version
$ sudo aptitude install lsb && sudo dpkg -i logmein-hamachi_2.0.1.15-1_i386.deb
Install 64-bit version
$ sudo aptitude install lsb && sudo dpkg -i logmein-hamachi_2.0.1.15-1_amd64.deb
The above command will also install a dependency lsb, which the Lab page stated is required for Hamachi before installing the downloaded package.


Next, start the service

$ sudo service logmein-hamachi start

The easiest way to join a network is to create one on the Logmein.com website. (This requires a free Logmein account and is fairly self explanatory). You'll nee to the Network ID (not the name) prior to proceeding. To configure the client on our server, first we set a nick name for this computer on the network. The nick name will show up in "Join" requests and on peer lists.

To connect your server to the network, follow these commands:
$ sudo hamachi do-join xxx-xxx-xxx 
$ sudo hamachi set-nick [Nickname]
$ sudo hamachi login

Password:
Joining xxx-xxx-xxx .. ok, request sent, waiting for approval
You will replace “xxx-xxx-xxxx″ with your own network ID. If you use a password on your network you need to enter it when prompted. I set up my Hamachi network so that all "Join REquest" must be manually approved by the adminstrator (me), so I don't have a password and just hit enter at the prompt. 

Once you see the waiting for approval message, log into your LogMeIn account and approve access for your server.


Once approved:

$ sudo hamachi list
You should see a list of networks you are joined to, currently one, the name of the network and a list of other peers connected to it. You will see the VPN IP address also of this peer. This is always in the 5.0.0.0 network. The other peer connected to my network is 5.163.224.23. Test connectivity using ping.

$ ping 5.163.224.23
If you get ping response, your connected and ready to go!