Can I restart my Mac remotely via screen sharing if the screen shows only linen?
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
                                             - &gt; btmm
                                             - - &gt; members
                                             - - - &gt; 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 &lt;computer's local hostname&gt;.&lt;number above&gt;.members.btmm.icloud.com.  Replace spaces with hyphens, and omit apostrophes (the default name is "Name's &lt;type of Mac&gt;")

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)