Why does the primary group of my user show up in /etc/group?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












0















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?










share|improve this question






















  • 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 at 17:36















0















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?










share|improve this question






















  • 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 at 17:36













0












0








0








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?










share|improve this question














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?







linux fedora group etc passwd






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 9 at 16:50









Tim GeldofTim Geldof

1




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 at 17:36

















  • 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 at 17:36
















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 at 17:36





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 at 17:36










1 Answer
1






active

oldest

votes


















3














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.



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.






share|improve this answer

























  • Indeed @roaima, fixed, thanks!

    – Stephen Kitt
    Jan 9 at 18:04










Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f493505%2fwhy-does-the-primary-group-of-my-user-show-up-in-etc-group%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









3














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.



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.






share|improve this answer

























  • Indeed @roaima, fixed, thanks!

    – Stephen Kitt
    Jan 9 at 18:04















3














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.



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.






share|improve this answer

























  • Indeed @roaima, fixed, thanks!

    – Stephen Kitt
    Jan 9 at 18:04













3












3








3







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.



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.






share|improve this answer















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.



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.







share|improve this answer














share|improve this answer



share|improve this answer








edited Jan 9 at 18:04

























answered Jan 9 at 17:34









Stephen KittStephen Kitt

168k24379457




168k24379457












  • Indeed @roaima, fixed, thanks!

    – Stephen Kitt
    Jan 9 at 18:04

















  • Indeed @roaima, fixed, thanks!

    – Stephen Kitt
    Jan 9 at 18:04
















Indeed @roaima, fixed, thanks!

– Stephen Kitt
Jan 9 at 18:04





Indeed @roaima, fixed, thanks!

– Stephen Kitt
Jan 9 at 18:04

















draft saved

draft discarded
















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f493505%2fwhy-does-the-primary-group-of-my-user-show-up-in-etc-group%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown






Popular posts from this blog

How to check contact read email or not when send email to Individual?

Displaying single band from multi-band raster using QGIS

How many registers does an x86_64 CPU actually have?