

Hamachi, a powerful VPN service that allows user to communicate securely from a remote network over an Internet connection, is also known as LogMeIn Hamachi, after taken over by another company. It is available in various operating systems; that is, Microsoft Windows, Linux and Mac OS X. However, automatic start-up is not the default option during installation. Here, I will illustrate how you can do so in Ubuntu Hardy Heron (which is also applicable to most other Linux distributions).
I assume that you are able to successfully install Hamachi as a user basis. If not, you can find out from the README instruction when you download the installation script.
- Create the start-up script for hamachi, as shown below. Remember to change the user name "keith" (line 5) to your system user name in Ubuntu (or your Linux distribution).
#!/bin/bash
###################################
### Start-up script for Hamachi ###
###################################
USER=keith
case "$1" in
start)
/sbin/tuncfg
/bin/su - $USER -c "hamachi start"
;;
stop)
/bin/su - $USER -c "hamachi stop"
;;
restart|force-reload)
/bin/su - $USER -c "hamachi start"
/bin/su - $USER -c "hamachi stop"
;;
*)
exit 1
;;
esacexit 0
- Make the script executable:
chmod +x hamachi
- Move the script to /etc/init.d/ directory:
sudo mv hamachi /etc/init.d
- Finally, run the following command to automatically link the script to the appropriate run-level during system boot up:
sudo update-rc.d hamachi defaults
It will then build the link as shown below:
Adding system startup for /etc/init.d/hamachi ...
/etc/rc0.d/K20hamachi -> ../init.d/hamachi
/etc/rc1.d/K20hamachi -> ../init.d/hamachi
/etc/rc6.d/K20hamachi -> ../init.d/hamachi
/etc/rc2.d/S20hamachi -> ../init.d/hamachi
/etc/rc3.d/S20hamachi -> ../init.d/hamachi
/etc/rc4.d/S20hamachi -> ../init.d/hamachi
/etc/rc5.d/S20hamachi -> ../init.d/hamachi - Finally, reboot your system and Hamachi will be automatically loaded and connected to the server.
Hamachi is one of the simplest way to link different networks across the Internet into one single Intranet. Many people made use of this for gaming and some several other purposes.
It is definitely very helpful if you are located far away from your server, and that someone could simply help you restart your server without needing to give administrative privilege to login to the server. Hamachi is then automatically loaded.
Special thank to an unknown guest who helped to improve the scripting.





























