2

I want to use a command line tool to get the list of allowed users for Remote Management (ARD). I was able to enable ARD using kickstart, but I'm having trouble finding how you get the information, not set it.

Is there a com.apple.Sharing or com.apple.ARD somewhere that I'm missing?

defaults /Library/Preferences/com.apple.ARDAgent

doesn't seem to give me the info I need.

Ok, did find

defaults /Library/Preferences/com.apple.RemoteManagement

but that only gave me whether all local users are allowed for ARD. That is useful, but I want a little bit more. Do I need to use dscl perhaps to find ARD groups?

2

I had a bit of a look at my Server and desktop Mac and it would seem that the permissions are stored in the local Open Directory database. The command dscl . -list /Users dsAttrTypeNative:naprivs when run by an admin will give you a list of users who have any privileges set for remote management.

  • Thanks, that's a good start. Does it really need to be run with admin privileges? It seemed to work for me either way. Not a big deal in this case, since other parts of my script need admin anyway. – labyrinth May 7 '14 at 22:12
  • The man page implied it did, but I'm an admin everywhere so I couldn't test without. – Tony Williams May 7 '14 at 23:12
  • I've been using the script for several days now and that command doesn't require root. Also, the command you gave has already proven more useful for our needs. We caught a user that shouldn't have been admin but didn't show in the usual System Preferences GUIs. – labyrinth May 14 '14 at 4:48
  • Despite having Remote Login on - and my name selected - this command returns nothing under sierra. I was unable to find anything close to your suggestion here. Is there something else possibly required for El Cap / Sierra ? – k3vmo Nov 10 '17 at 19:12
2

@k3vmo in Tony's post.

Reading naprivs as shown in the command suggested by Tony (dscl . -list /Users dsAttrTypeNative:naprivs) does work on Sierra.

The Sharing preference "Remote Login" is different from the "Remote Management" setting, which is what the naprivs attribute reports on.

If you are interested in listing users with "Remote Login" access (i.e. users with SSH access), use the command:

sudo dscl . -read /Groups/com.apple.access_ssh/ | grep GroupMembership | cut -d: -f2

Remote Login = ssh access

Remote Management = screensharing/VNC access

You must log in to answer this question.

protected by Community Dec 14 '17 at 21:10

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged .