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 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
add comment

1 Answer

up vote 0 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
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.