SK0-004 · Question #621
A systems administrator is tasked to add an existing user to an existing group on a local Linux system. Which of the following files should be edited to accomplish this task?
The correct answer is B. /etc/passwd file. On a Linux system, the /etc/passwd file contains user account records including each user's primary group ID (GID), which defines the user's group association at login.
Question
A systems administrator is tasked to add an existing user to an existing group on a local Linux system. Which of the following files should be edited to accomplish this task?
Options
- A/etc/group file
- B/etc/passwd file
- C/etc/hosts file
- D/etc/group_membership file
How the community answered
(55 responses)- A2% (1)
- B93% (51)
- C4% (2)
- D2% (1)
Why each option
On a Linux system, the /etc/passwd file contains user account records including each user's primary group ID (GID), which defines the user's group association at login.
While /etc/group lists group names and their supplementary members, the primary group assignment for a user account is stored in the GID field within /etc/passwd, not /etc/group.
The /etc/passwd file stores the full user account record, including a field for the user's primary group ID (GID), which links the user to their primary group. Editing this file allows an administrator to change which group a user is associated with by updating the GID field in the user's record. This is the file that controls the group the user is assigned to at the system account level.
/etc/hosts maps hostnames to IP addresses for local name resolution and has no relationship to user or group account management.
/etc/group_membership is not a valid or standard Linux system file; it does not exist in standard Linux distributions.
Concept tested: Linux user and group management via /etc/passwd
Source: https://man7.org/linux/man-pages/man5/passwd.5.html
Topics
Community Discussion
No community discussion yet for this question.