Activate Apple Remote Desktop Sharing from remote command line

I recently needed to access the GUI of my Mac at work from home. Alas, Apple Remote Desktop Sharing was turned off.

Here’s how to turn on Remote Desktop Sharing from the command line. This assumes you have Remote Login (SSH) turned on in system preferences. If not, you’re hosed.

1. Open Terminal.app, and enter:
ssh -l jblow my.workmac.com
where ‘jblow’ is a valid username on your Mac, and ‘my.workmac.com’ is the host name and domain name of your machine.

2. Activate Remote Desktop Sharing for a specific user, enabling access priveleges for that user, and grant full access priveleges for that user (keep all the command options on one line):

$ sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -users jblow -privs -all -restart -agent -menu

Here’s the output to expect:

Starting...
Created preference to start ARD after reboot.
Stopped ARD Helper.
Stopped ARD Agent.
Stopped ARD Database.
Stopped VNC Server.
jblow: Set user remote control privileges.
jblow: Set user remote access.
Started ARD Agent.
Done.

Note that this technique causes ARD to start at boot time as well.

To turn off ARD and deactivate it (so that it doesn’t load at boot time):

sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -deactivate -configure -access -off

Starting...
Removed preference to start ARD after reboot.
jblow: Set user remote access.
Done.

2 thoughts on “Activate Apple Remote Desktop Sharing from remote command line

  1. Pingback: Apple Remote Desktop via Terminal einschalten — instant-thinking.de

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.