1

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

3therk1ll
  • 2,056
  • 4
  • 35
  • 64
  • 1
    There is more to creating entries with `dscl` then just creating the entry in `/Groups` you also need to set up the `PrimaryGroupID` and maybe some other attributes. There is no `root` group by default, i think what you want is `wheel` or `admin`.... unless you want to introduce a group of `root` on your own that is. – prodigitalson Feb 24 '15 at 23:25
  • @prodigitalson Yeah you were right, changed the `dscl` command the following and it worked fine. `sudo dscl . -create /Groups/root PrimaryGroupID 100` – 3therk1ll Feb 24 '15 at 23:37

1 Answers1

1

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.

Donald.M
  • 96
  • 6