Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I added a user user01 to a group group01 using: usermod -a -G group01 user01

When I run in command id user01 it shows that this user has actually been added to the group.

However, the file /etc/group doesn't reflect this. i.e. I believe that on this file, users that belong to each of the groups should be listed next to it. Please correct me if I am wrong.

This is a fresh installation of CentOS 6.4

Also, since id user01 shows that this is updated, is there any way to check all the members of group group01?

share|improve this question
up vote 1 down vote accepted

If you run getent group group01 you should see a list of all members of that group.

share|improve this answer
Thanks @John. The command works and I am able to see the users in this group using this. Do you know if /etc/group/ is supposed to be automatically updated with the list of members? And if so, any reason why it would not update? Thanks for your help! – slayernoah Nov 7 '13 at 15:56
Updating /etc/group is one way of recording new group memberships. I'm not really sure if this is supposed to happen automatically or not. I'd need to know a lot more about your environment before I could really have any idea where to look next. – John Nov 7 '13 at 16:00
I just installed a fresh copy of CentOS and I am only using this to familiarize myself with linux. I just created groups and assigned memberships without directly writing to the /etc/group file. Not sure why the file doesn't update when I do so.. – slayernoah Nov 7 '13 at 16:02

/etc/group is a source of group information, but not necessarily the only one. If your system is set up to use NIS, LDAP, or some other source of user/group information, that information will not necessarily be reflected in /etc/group.

getent reads and reports from all of the configured data sources, of which /etc/group is only one. I specifically use getent because I use local password/group information in conjunction with a remote LDAP source (configured with PAM modules) and wanted to have consolidated information.

Also, /etc/group is not updated automatically based on external authentication sources. It is updated directly, either using an editor (such as vi, emacs, etc) or by tools for modifying user/group information (groupadd, useradd, etc).

share|improve this answer

Your Answer


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.