Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I find that if I want to sign a user to certain group, just modify the group id in the /etc/passwd file.

yozloy:x:501:5:this is my own user::

It already works! why should I add the user name in the group file?

admin:x:5:yozloy

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

In Unix like operating systems, users are organized into groups, every users is in at least one group(primary group), and may be in other groups. Group membership gives you special access to files and directories which are permitted to that group.

Every user is in a primary group defined in /etc/passwd and may be in several supplementary groups(additional groups defined in /etc/group).

share|improve this answer
add comment

The group in /etc/passwd is the user's primary group. /etc/group allows users to belong to additional groups.

share|improve this answer
add comment

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.