I'm following a course about Linux and it states the following: "The primary group of a user is not mentioned in the /etc/group file."

However, my primary user "timgeldof" actually does show up in the /etc/group file. I have verified that the user indeed has "timgeldof" as primary group using the id and the groups command.

The rule stated in my course does apply for every other user though. Does it matter that the user timgeldof is the first user I created during installation?

  • 1
    you'd have to squint just the right way to interpret it correctly, perhaps as "the primary group of a user is not dictated by /etc/group, but by /etc/passwd (or the equivalent user database)"
    – Jeff Schaller
    Jan 9, 2019 at 17:36
  • The primary group is the group which automatically is used when creating new files/directories.
    – paladin
    Sep 28, 2021 at 4:41

1 Answer 1


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:


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.


You must log in to answer this question.

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