/etc/group: why the username does not appear in its own primary group?
According with many tutorials in the /etc/group
file is listed all the groups.
Through the cat /etc/group | grep omicron
command (omicron is the default custom user created in the Linux installation) appears:
adm:x:4:syslog,omicron
cdrom:x:24:omicron
sudo:x:27:omicron
dip:x:30:omicron
plugdev:x:46:omicron
lpadmin:x:120:omicron
lxd:x:132:omicron
omicron:x:1000:
sambashare:x:133:omicron
According with the output I can understand that each line represents:
- The group name
- The
X
represents something about password or some protection - The
gid
is the id of the group - Finally what users are assigned to the group.
What is not clear for me:
- why appears
omicron:x:1000:
and notomicron:x:1000:omicron
?
The omicron
user has its primary group omicron
too
Solution 1:
A user doesn't need to be listed as the member of a group in /etc/group
if that group is their primary group. That's just how it is and has been for decades. Some user management tools do explicitly put the user in the /etc/group
list, but not all.