Google
Sany Asyari Blog - Indonesia

Instalasi Hamachi di Debian, Ubuntu, Fedora

Sany Asyari| August 27, 2009 2:44 pm

Hasil copy paste dari

http://rafal.zelazko.info/2007/07/10/hamachi-for-debian-ubuntu/

http://www.howtoforge.com/how-to-install-hamachi-on-fedora9

Hanya untuk catatan pribadi

Install
To install hamachi on debian or ubuntu follow steps:

sudo su
aptitude install build-essential
wget -c http://www.rafekz.one.pl/hamachi_0.9.9.9.20.deb
dpkg -i hamachi_0.9.9.9.20.deb
rm hamachi_0.9.9.9.20.deb

Whats next?
If you have hamachi installed you can:

  • Join to network
    sudo hamachi -c /etc/hamachi join <network> [<password>]
  • Create your own network
    sudo hamachi -c /etc/hamachi create <network> [<password>]
  • Log in to hamachi
    sudo hamachi -c /etc/hamachi login
  • Go online
    sudo hamachi -c /etc/hamachi go-online <network>
  • List users in your networks:
    sudo invoke-rc.d hamachi status
    (you can enter this command twice to view nicknames)

1 Download Hamachi

Hamachi can be downloaded from the main website here:

https://secure.logmein.com/products/hamachi/download.asp

Download the 0.9.9.9-20 Linux version with the following filename:

hamachi-0.9.9.9-20-lnx.tar.gz

Or skip all that and do a wget on the file from the link here:

wget http://files.hamachi.cc/linux/hamachi-0.9.9.9-20-lnx.tar.gz

Ungzip and extract the tar file to a folder and then cd into the directory:

tar -xvf hamachi-0.9.9.9-20-lnx.tar.gz
cd hamachi-0.9.9.9-20-lnx

Make sure you are able to sudo or su to root for the next step.

2 Install and recompile tuncfg

In order to run hamachi you will need to fix the path for ifconfig in most Fedora-based distributions.

cd tuncfg

(I took this information from a post by feistyfeline on linuxquestions.org here is a link to the original posthttp://www.linuxquestions.org/questions/linux-software-2/cant-log-in-with-hamachi.-409344/)

Rename the original tuncfg file in that folder (only if you need to):

mv tuncfg tuncfg.backup

Use your choice of text editor to edit the tuncfg.c file. Search for the piece of code that has ifconfig. There is only one instance of that.

Change:

"ifconfig %s %u.%u.%u.%u ", ctx[i].dev,

To:

"/sbin/ifconfig %s %u.%u.%u.%u ", ctx[i].dev,

Then:

gcc tuncfg.c -o tuncfg

That recompiles tuncfg to incorporate the changes you made. Next, if you had already started tuncfg, kill all instances of tuncfg with:

killall tuncfg

Next, run the following as root to install the new tuncfg:

make install
/sbin/tuncfg

[aru@boxee hamachi-0.9.9.9-20-lnx]$ sudo make install

Copying hamachi into /usr/bin ..
Creating hamachi-init symlink ..
Compiling tuncfg ..
Copying tuncfg into /sbin ..

Hamachi is installed. See README for what to do next.

Finally, run “hamachi start” as a regular user and you may proceed as indicated in the README file.

3 Install & start Hamachi

Per the README file, install hamachi as a regular user by running hamachi-init:

hamachi-init

Initializing Hamachi configuration (/home/aru/.hamachi). Please wait ..

generating 2048-bit RSA keypair .. ok
making /home/aru/.hamachi directory .. ok
saving /home/aru/.hamachi/client.pub .. ok

hamachi start

Starting Hamachi hamachi-lnx-0.9.9.9-20 .. ok

4 Configure Hamachi

Once you are able to start Hamachi, you can then proceed to login and configure it to join a network:

hamachi login

hamachi join “networkname”

If To see other clients on your hamachi network type:

hamachi list

If no command is specified, hamachi displays its status including version, pid, online status and the nickname. Or you can get a list of commands by typing:

hamachi help

Once you’ve created or joined a network you can set up hamachi to start on boot by editing the rc.local file:

sudo vi /etc/rc.local

  /sbin/tuncfg
su - user -c "hamachi start"

Or you can set up Hamachi as a service by using a init.d script like the one described in the blog here by cannin:http://idahospuds.blogspot.com/2006/03/scitech-hamachi-as-service-in-fedora.html

#!/bin/bash
#
# hamachi         This shell script takes care of starting and stopping
#                 hamachi.
#
# chkconfig: 345 99 9
# description: hamachi is a zero-configuration VPN
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ "${NETWORKING}" = "no" ] && exit 0
[ -f /etc/hamachi/client.pri ]  exit 0
[ -f /etc/hamachi/client.pub ]  exit 0
[ -f /usr/bin/hamachi ]  exit 0
# See how we were called.
case "$1" in
start)
 echo "Starting hamachi..."
 /sbin/tuncfg
 /usr/bin/hamachi -c /etc/hamachi start
 ;;
stop)
 echo "Stopping hamachi..."
 killall tuncfg
 /usr/bin/hamachi -c /etc/hamachi stop
 ;;
restart)
 stop
 sleep 1
 start
 ;;
  *)
 echo "Usage: hamachi {startstoprestart}\n"
 exit 1
esac
exit 0

(I actually just went with the rc.local commands as I found that as long as I leave my server running most of the time my need for a service isn’t all that great. I just needed it to startup when there is a power outage.)

Make sure to verify that both tuncfg and hamachi are running afterwards by doing a ps:

ps -ef | grep tuncfg 
ps -ef | grep hamachi

Now you can access your server from anywhere you are able to install a hamachi client from. If you want a GUI interface, you can also look into installing one from the links below.

No Comments

(Required)
(Required, will not be published)
Get Adobe Flash playerPlugin by wpburn.com wordpress themes