How can I get the list of allowed users for Remote Management via Terminal?

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.


@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