Tuesday, 6 April 2010

Easiest way to login to your home Mac

Well, there're few prerequisites to this method:



  1. You should have a DMZ'ed (or accessible from outside world in some way) server running in your home network which you can SSH into.


  2. Your home Mac should be on (you can use etherwake command from within your network to wake it up first).


As long as these two criteria are met, you simply do:




laptop:~ kirillov$ ssh -p19322 -L59000:imac:5900 user@home.selfip.org -fN


The bit



-p19322



you need only if you're running your SSH daemon on a non-standard port (or your forwarding is set from a non-standard port); either way, it is highly recommended. This piece



-L59000:imac:5900



says "I want to forward all requests coming on port 59000 of my localhost to host imac in the target network, port 5900" (which is a default VNC port). Finally,



my_home_username@myhomeserver.selfip.org -fN



is pretty straightforward, "-fN" says "go to background right after asking for login and password if they are needed".


After you've done that, all you need to do it to hit ⌘K in your Finder (or start a dedicated VNC application) and do:


Screen shot 2010-04-06 at 12.14.02.png


After that you're likely to be asked for login and password, which, by coincidence will be login and password from your home Mac. And you're in!