2

I want to create a developers group on my OS-X system. I'm executing:

sudo dscl . -create /groups/developers
sudo dscl . -append /groups/developers passwd 'blah'

My understanding from reading various sources is that I should assign an id to the group with

sudo dscl . -append /groups/developers gid xxx

where xxx is the desired id. My question is, what is an appropriate value for xxx? Is there a convention? Are there any BAD choices? Do I have to worry that something else will want to use the same group id?

Wesley
  • 32,320
  • 9
  • 80
  • 116

2 Answers2

2

One thing you have to take care when choosing a group id is that the id is not already used by another group. In order to list the existing group ids in numerical order you can do:

dscl . -list /groups PrimaryGroupID | awk '{print $2}' | sort -n
Silviu
  • 637
  • 8
  • 15
2

OS X conventionally uses different ID ranges for different types of accounts. Here's the current layout as I understand it:

up to 100: Reserved for static system-defined (built in) groups
101 - 199: Used by the OS for dynamically-created groups (e.g. share point access groups)
200 - ?: More static system groups (apparently 100 wasn't enough)
400 - 500: More dynamic system groups
501 and up: Local admin-created groups
1024 and up: Domain-based admin-created groups

Since you're creating a local group, I'd look for the first available ID number above 500.

Gordon Davisson
  • 11,036
  • 3
  • 27
  • 33