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
lisa:x:1001:
lisa_m:x:1002:
betty:x:1009:
sales:x:1007:bob,betty,linda,lisa
account:x:1008:bill,beatrix,lori,bob
bill:x:1010:
beatrix:x:1011:
linda:x:1003:
wheel:x:10:intore,lisa,lisa_m
intore:x:1000:intore
group
file. I hope that output from can is trimmed./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.