Why does the primary group of my user show up in /etc/group?
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
add a comment |
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
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
add a comment |
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
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
linux fedora group etc passwd
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
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
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.
Indeed @roaima, fixed, thanks!
– Stephen Kitt
Jan 9 at 18:04
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
Indeed @roaima, fixed, thanks!
– Stephen Kitt
Jan 9 at 18:04
add a comment |
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.
Indeed @roaima, fixed, thanks!
– Stephen Kitt
Jan 9 at 18:04
add a comment |
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.
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.
edited Jan 9 at 18:04
answered Jan 9 at 17:34
Stephen KittStephen Kitt
167k24376454
167k24376454
Indeed @roaima, fixed, thanks!
– Stephen Kitt
Jan 9 at 18:04
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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