How to remove a user from staff group in macOS?
I was also having trouble with this, all the other resources/answers I had found didn't work for me. I finally figured it out (have only tested on my machine on Catalina). This is kind of a kitchen sink approach so some of these steps might be unnecessary, but this is what I did and it worked. I'm not an apple engineer so YMMV and do at your own risk.
Say we want to remove staff group for a user with the name &quot;someuser&quot;

Setup a shell script like this: https://superuser.com/a/395738 it'll make debugging easier. Assuming you've saved it in a file members.sh with executable permission, You can double check that it is working by doing:

./members.sh  staff

and seeing if someuser appears in the list.

From the system preferences UI create a new group, you can do this by under &quot;Users &amp; Groups&quot; hitting the plus sign and selecting group in the drop-down box. It doesn't matter what you call it, we'll say &quot;new_group&quot;

Select that group in the UI and check the box next to &quot;someuser&quot;

Right click on &quot;new_group&quot; from the UI and select advanced options, copy the Group ID # (not UUID), it should be a regular number. Say the number is 1234.

Now we are going to change someusers's primary group to new_group instead of staff (see also: https://apple.stackexchange.com/a/81553/409162). Do the following:


sudo dscl . -create /Users/someuser PrimaryGroupID 1234

(where 1234 is the number you copied in step 4)

Right click on someuser from the UI, select &quot;Advanced Options&quot; and in the &quot;Group&quot; textbox, change &quot;staff&quot; to &quot;new_group&quot;. If you close and re-open this &quot;Advanced Options&quot; window it should stay set to new_group.

Finally remove the user from staff. Run the following (note: I got this from the &quot;EXAMPLES&quot; section of man dseditgroup you may want to double check there to confirm)


sudo dseditgroup -o edit -u someuser -p -d someuser -t user staff

You may have to enter your password because it is a sudo command, but when it says &quot;Please enter user password&quot; this refers to someusers's password.

Run ./members.staff to check that someuser was successfully removed. If someuser is still in the list:

Restart your computer
Re-run the command in step #7
Check again



I've tried this a couple times, sometimes restarting was necessary, other times it wasn't. Sometimes re-running the command was necessary, other times it wasn't