Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

This is such an elementary question, and I can't believe I've been using Unix (Linux and Mac) for over 5 years without knowing this!

The root user has group id 0 and user id 0. Hence lower group ids have more permission. The question is, if I want to create an administrator group, where all members have the same rights as the root group, is that a safe practice? And do I create than by setting to the group id to 0? All this time I've been going along with sudo but that's because I've been the only user on my machine or vps.

Also, when a group id is say 10 or 100, can it perform any operation on any file that belongs to a group that say has an id of 1000? Is that how that's supposed to work?

Thanks,

Sam

share|improve this question
2  
You seem to have misunderstood something. You don't get "more" permissions by having a lower UID or GID, unless it happens to be 0 (root). –  Michael Hampton Sep 20 '12 at 17:55
1  
Look into the principal of the wheel group and read up on visudo and sudoers –  Sonassi Sep 20 '12 at 17:58
    
You are confusing Unix/Linux operations with that old and venerable VAX system where userid numbering did determine native permissions. Yes, there were other ways to assign privs too. –  mdpc Sep 20 '12 at 18:06

1 Answer 1

up vote 1 down vote accepted

Each group in UNIX systems has its own unique ID. This is the primary identifier, the name is just some kind of alias.

In Unix systems, every user must be a member of at least one group, which is identified by the numeric GID of the user's entry in /etc/passwd. (from here)

The numerical value of the group ID is not in any way connected to the permissions of that group. Group ID 0 is a special case, as it's always the superuser group.

The question is, if I want to create an administrator group, where all members have the same rights as the root group, is that a safe practice? And do I create than by setting to the group id to 0?

Per sé this is not a safe practice. sudo has been invented for a reason. Modern distributions have a sudo or admin group. Add the user you want to use for admin tasks to this group.

share|improve this answer
    
Thanks. I'm using Ubuntu (for the last couple of years). What I had been doing is adding my user to the sudoers groups and just running commands with sudo. I thought there might be a better practice. When I edit /etc/sudoers can I specify a group instead of a user? –  Sam Hammamy Sep 20 '12 at 19:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.