May 19, 2012
tom

How are group ids assigned?

Question

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?

I’m sorry if these are novice questions.

Asked by DeepYellow

Answer

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.

Answered by Gordon Davisson

No related posts.

Leave a comment