The rule isn’t quite accurate; it should say
- on systems using
/etc/passwd
and /etc/group
, the primary group of a user is defined in /etc/group
(this determines its identifier);
- a user doesn’t need to be listed as a member of his/her primary group.
As stated (in your question and in the version above), this doesn’t forbid your user appearing as a member of your primary group in /etc/group
, because the primary group is defined in the user entry, not as a result of group membership. See man 5 passwd
:
GID
This is the numeric primary group ID for this user. (Additional groups for the user are defined in the system group file; see group(5)
).
At least on Linux, when you log in, your group memberships are initialised as follows:
- your primary group is set to match your defined primary group (from
/etc/passwd
or wherever your user information is stored);
- your additional groups are set up to match the groups you’re a member of, and your primary group.
Thus it doesn’t matter whether your primary group lists you as a member or not.
Incidentally, it appears that, as you mention, the user created during installation is listed as a member of his/her primary group, on Fedora and presumably other distributions using Anaconda.