Home > Mac > OSX: How to use ssh using Back to My Mac

OSX: How to use ssh using Back to My Mac

10.5: How to use ssh using Back to My Mac – Mac OS X Hints.

In summary, if you need to ssh a mac of yours to which you have “Back to My Mac” access, just do this:

ssh hostname.username.members.mac.com

where “hostname” is the name of the machine you want to ssh, and “username” is you MobileMe account username.

[UPDATE for iCloud and OSX Lion 10.7.2]

in iCloud, it’s the same idea, but uses a different domain (members.btmm.icloud.com), everything else works the same. You can find your domain by poking around with the “mDNS” utility and the -E arg (Enumerate recommended registration domains):

mymachine1:~ myusername$ mDNS -E 
Looking for recommended registration domains:
Talking to DNS SD Daemon at Mach port 5891
14:25:23.650 Recommended Registration Domain local. Added
14:25:23.650 Recommended Registration Domain XXXXXXXXX.members.btmm.icloud.com. Added

In OSX 10.8.x instead of mDNS -E, use dns-sd -E (more info here)

Where XXXXXXXXX is a number. I can now do:

 ssh mymachine2.XXXXXXXXX.members.btmm.icloud.com

from any machine signed into iCloud (in the example, mymachine2, for which I have BackToMyMac active and registered in my iCloud account).

It would be nice though to use instead of the XXXXXXXX number your iCloud username… otherwise, you first need to have terminal access to a machine registered in your iCloud BackToMyMac pool. :-\ Must investigate this option.

Categories: Mac Tags: , , , ,
  1. Bob
    December 10, 2011 at 8:11 pm

    Thanks! FYI to others if your machine name has spaces in it replace them with hyphens… For example, ssh bobs-computer.XXXXXXXXX.members.btmm.icloud.com

  2. December 17, 2011 at 1:34 am

    This is pretty cool! Does this number (XXXXXXXXX) ever change?

  3. lgustavomartins
    December 17, 2011 at 10:59 am

    I think that the XXXXXXXX number is related to your iCloud ID, so it should be unique and a constant for each iCloud user. Anyone can confirm this?

  1. February 11, 2012 at 6:38 pm
  2. February 11, 2012 at 6:44 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: