Change group with chown in OSX

7.3k Views Asked by At

Trying to change the group for a file on OSX to root, keep getting an illegal group name error though. Looked around and all the demos match what I'm using. Am I missing something here? Tried to create a group with dscl as well with the same result

Command: dscl . -create /Groups/root

Command: sudo chown root:root $file

Error: chown: root: illegal group name

1

There are 1 best solutions below

0
On

When I had this issue (macos 10.12.x) I needed one final command for the initial command to work and no longer throw the

illegal group

error.

dscl . -create /Groups/groupName GroupMembership userName

I had done the PrimaryGroup command which didn't work until the command above was added.