If I am not wrong, the file /etc/group shows the list of the groups and for each one are listed the users that are members as secondary group only. I created some users in order to do some test. The strange behavior is that my user is listed in my primary group. The other users don't appear in them primary groups. Do you have any idea? Here you are the example on my CentOS system:

[root@server2 ~]# id intore
uid=1000(intore) gid=1000(intore) groups=1000(intore),10(wheel)

root@server2 ~]# cat /etc/group
  • 2
    What system is this on and how did you create the users?
    – Kusalananda
    Commented Jan 20, 2018 at 13:10
  • This looks like a very wrong group file. I hope that output from can is trimmed.
    – fugitive
    Commented Jan 20, 2018 at 13:38
  • @Kusalananda: the system is CentOS 7, the user "intore" is the first user created during the installation process. The other users have been added by using useradd command
    – intore
    Commented Jan 20, 2018 at 14:28
  • @fugitive: sure, that output is a part of the group file
    – intore
    Commented Jan 20, 2018 at 14:29
  • Note that it doesn't make any practical difference. A user is in the group specified as their primary group in /etc/passwd (or, more generally, getent passwd), AND in any groups that list them in /etc/group (getent group). They may, or may not, be listed explicitly in their primary group's entry but it makes no difference to their group membership status either way.
    – cas
    Commented Jan 21, 2018 at 5:11

1 Answer 1


If you add a user to a group by making the group its primary one then the user is not added to the user list in /etc/groups.

Some distros create a group for each user. It makes some sense to add the user to that group in the group file so that the user is a member even if the primary group is changed.

Of course, you could make that argument for other groups, too.

  • so my user intore appears because is the one I defined during the installation?
    – intore
    Commented Jan 20, 2018 at 14:38
  • @intore That may be the reason. Perhaps this difference is not even intentional. Commented Jan 20, 2018 at 14:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .