LX0-104 · Question #25
Which of the following files assigns a user to its primary group?
The correct answer is D. /etc/passwd. The /etc/passwd file assigns a user to their primary group by storing the primary group's GID within the user's account entry.
Question
Options
- A/etc/pgroup
- B/etc/shadow
- C/etc/group
- D/etc/passwd
- E/etc/gshadow
How the community answered
(36 responses)- A3% (1)
- D94% (34)
- E3% (1)
Why each option
The /etc/passwd file assigns a user to their primary group by storing the primary group's GID within the user's account entry.
/etc/pgroup is not a standard Linux file used for primary group assignment.
The /etc/shadow file stores encrypted user passwords and password aging information, not primary group assignments.
The /etc/group file lists groups and their members (supplementary groups), but the primary group assignment for a user is defined in /etc/passwd.
The /etc/passwd file stores user account details, with the fourth field (GID) indicating the numeric ID of the user's primary group. When a user logs in, this GID determines their initial group membership and default file creation permissions.
The /etc/gshadow file stores encrypted group passwords and group administration information, similar to /etc/shadow for users.
Concept tested: User primary group assignment
Source: https://man7.org/linux/man-pages/man5/passwd.5.html
Topics
Community Discussion
No community discussion yet for this question.