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.
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
This is pretty cool! Does this number (XXXXXXXXX) ever change?
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?