At home I have a Mac Mini connected to my TV & my Synology NAS; to control it, I connect to the Mini from my MacBook Pro using Apple’s built-in Screen Sharing. Every once in a while, for no apparent reason, Screen Sharing is unable to connect to the Mini. Spin city. I can still SSH in to the Mini1, though, so in those cases I run the following command to restart Screen Sharing on the Mini:

sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -restart -agent -console

After that, I can once again connect to the Mini & watch a movie or listen to music. Equilibrium is restored.

Since I am nothing if not lazy, I of course added an alias to the Mini’s .bash_aliases file:

alias restartard='sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -restart -agent -console'

The name of the alias, restartard, refers to the fact that Apple calls the underlying technology, as well as the pro tool it sells to remotely manage Macs, Apple Remote Desktop, or ARD.

  1. If I can’t SSH in, then I’m having bigger troubles than a simple hiccup with Screen Sharing.