LFCS · 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 containing the Group ID (GID) of that group within the user's entry.
Question
Options
- A/etc/pgroup
- B/etc/shadow
- C/etc/group
- D/etc/passwd
- E/etc/gshadow
How the community answered
(23 responses)- C9% (2)
- D87% (20)
- E4% (1)
Why each option
The `/etc/passwd` file assigns a user to their primary group by containing the Group ID (GID) of that group within the user's entry.
`/etc/pgroup` is not a standard file for managing primary groups in Linux.
`/etc/shadow` stores encrypted passwords and password expiration information, not primary group assignment.
`/etc/group` defines group names and their members (supplementary groups), but the primary group assignment for a user is listed in `/etc/passwd`.
The `/etc/passwd` file stores user account information, and the fourth field in each user's entry explicitly specifies the numeric Group ID (GID) of their primary group, linking the user to their initial group membership.
`/etc/gshadow` stores encrypted group passwords and group administration information, similar to `/etc/shadow` for users.
Concept tested: Primary group assignment in /etc/passwd
Source: https://linux.die.net/man/5/passwd
Topics
Community Discussion
No community discussion yet for this question.