Wednesday, January 4, 2017

Setup Hamachi to ssh from anywhere




My home network is behind ISP NAT (damn, yes no public IP for me and also port forwarding won't work in this case), but I still want to ssh into my Linux pc at home, so how to ssh into home LAN behind ISP NAT?

Here is how, use Hamachi

First install it on your linux box:
wget https://www.vpn.net/installers/logmein-hamachi_2.1.0.174-1_i386.deb
sudo apt-get install lsb
sudo dpkg -i logmein-hamachi_2.1.0.174-1_i386.deb 
 
Then login to hamachi page and create a new Mesh network. After created a Mesh network, remember the Network ID xxx-xxx-xxx since the hamachi do-login command needs it.


Back to the command line
sudo hamachi login
sudo hamachi set-nick $HOSTNAME
sudo hamachi do-join XXX-XXX-XXX
 
Then back to the webpage again and allow the clients to be on this network. (maybe need to have the client to login again)

Then you need to install LogMeIn Hamachi on your remote pc (you can get the download link from your LogMeIn web login page via Networks => Deployment => Add New Link). Then click Joining an existing network after install, login with your email address (after that will send a request to your LogMeIn account for approval if you configure your Mesh network this way). Sure you will approve yourself after LogMeIn online account receive the request.

Now you can grab that virtual IP number (on your My Networks page) and ssh directly regardless if there is a NAT in the way!

0 Comments: