HOW TO: Remote SSH Into Your Home Mac Through iCloud’s Network

If you have more than one Mac running OS X Mountain Lion ( or Lion ) and you’re signed in to the same iCloud account on all of them, you can SSH between them via iCloud’s IPv6 network.

Jump over the break to check out how to do it…

First off, you need to make sure Back to My Mac is enabled in iCloud. To do that go to System Preferences > iCloud > Back to My Mac.

Next, you need to set up your home computer for sharing if it isn’t already. Go to System Preferences > Sharing and turn on at least File Sharing and Remote Login.

With everything set, you can now remote log in to your home computer using iCloud’s network wherever you have internet access.

The first thing you need to do is find your Back to My Mac account number. To do that, open terminal (Applications > Utilities) and type:

dns-sd -E

The final, nine digit number is your Back to My Mac account number.

Then SSH to another machine like so

ssh -2 -6 username@computer-name.[account number].members.btmm.icloud.com

That’s hard to remember and a hassle to type, so might want to add something like the following to your ~/.ssh/config:

Host mac-remote
User username
HostName computername.123456789.members.btmm.icloud.com
AddressFamily inet6
Protocol 2

Which means you can just type:

ssh mac-remote

With that, you should have access to your Mac no matter where you are.

Enjoy!

[via]