Howto remote restart ARD from SSH
If you have ever been working with an Apple server/desktop you will have come across ARD. It’s Apple Remote Desktop and it’s quite neat. But it’s sadly only for Mac. This means if your on another OS you need some other way to connect. Luckily ARD is really just VNC with some Apple Propriety addons so if enabled we can VNC straight to the machine, however it does have a few issues. One major problem is that ARD falls over quite a lot, especially if you use incorrect settings like the new experimental 2mbit mode within UltraVNC etc. So if you manage to crash ARD what you need to do is restart it and that can be a pain if the server is remote. As OSX shares many traits with other UNIX operating systems you can in most cases SSH in and restart the service, to do this simply run the command below and you should then be good to go.
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -deactivate -stop
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -privs -all -restart -agent