Question

I am currently in Norway. My Mac mini is in my apartment in Australia. I can access screen sharing via Back To My Mac. It connects fine, but the screen has only linen - no menu bar, no dock, no anything else. I am fairly sure that is what is actually on the screen and that it isn't a problem with the connection or anything like that (it's happened once before while I was sitting in the same room...)

I know the system is responsive because the one other thing that can poke through my router is the Transmission web interface, and that works just fine. (Unfortunately I seem to have neglected to forward a port for ssh...)

Is there any way I can reboot or otherwise regain full use of the system via the limited screen sharing access that I have?

Was it helpful?

Solution

So apparently you can use the Back To My Mac infrastructure to get to SSH even if there's no port open on the router in front of the relevant Mac:

Find your iCloud account number by executing this command in terminal:

dns-sd -E

Example output

Looking for recommended registration domains:
Timestamp     Recommended Registration domain
23:45:15.660  Added     (More)               local
23:45:15.660  Added                          icloud.com
                                             - > btmm
                                             - - > members
                                             - - - > 123456789

(Make a note of the number on the last line, in this case 123456789 (this is just an example).

The hostname you need to use for ssh is <computer's local hostname>.<number above>.members.btmm.icloud.com. Replace spaces with hyphens, and omit apostrophes (the default name is "Name's <type of Mac>")

The command I used therefore was:

ssh -2 -6 Jons-mac-mini.123456789.members.btmm.icloud.com

To complete the solution to my problem (rebooting), once logged in via SSH, I used the following command to restart:

sudo /sbin/shutdown -r now

(Sourced from here)

OTHER TIPS

In this page says that Control-Eject show you a shutdown dialog. (You need a keyboard with an eject key.)

If you want to remotely restart the machine without having to specify the user then you can specify an input file in the form of a plist. Do the following steps on the computer that you are remoting into:

  1. First you need to create a plist file that will have your credentials, open up a terminal window and paste the following: touch ~/.restart.plist. Now open up that plist file in a text editor and paste the following:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>Username</key>
    <string>USERNAME_HERE</string>
    <key>Password</key>
    <string>PASSWORD_HERE</string>
    </dict>
    </plist>
    
  2. Replace USERNAME_HERE and PASSWORD_HERE in the file above with your credentials and save the file.
  3. Create an alias in your bash profile so that all you have to do is type reboot and it will do the rest for you. Open up your ~/.bash_profile in a text editor and add the line alias reboot="sudo fdesetup authrestart -inputplist < ~/.restart.plist" then save the file.
  4. Close and reopen your terminal window, or type in source ~/.bash_profile in order to update your alias to match the bash profile.

Now you'll be able to restart your remote computer with a specific user just by typing reboot into your terminal!

Source

Licensed under: CC-BY-SA with attribution
Not affiliated with apple.stackexchange
scroll top