This is kinda cool. It only works if you have access to “Back to My Mac” service and you have it turned on in the remote mac’s preferences (under iCloud preferences). If you ever need to find out the FQDN (Fully Qualified Domain Name) of your remote mac and connect to it via ssh or something like it you can use the following command in the terminal:
echo show Setup:/Network/BackToMyMac | scutil | sed -n 's/.* : *\(.*\).$/\1/p'
This should spit out the “domain name” for your “personal” iCloud DNS. The output looks something like this:
To use this in a ssh command you would need the name of the remote machine plus the information above:
ssh -2 -6 remote-hostname.12345678.members.btmm.icloud.com
That’s it…..you should see a prompt for ssh login to your remote machine.