nerdexam
CompTIA

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.

Server administration

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)
  • A
    2% (1)
  • B
    93% (51)
  • C
    4% (2)
  • D
    2% (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.

A/etc/group file

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.

B/etc/passwd fileCorrect

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.

C/etc/hosts file

/etc/hosts maps hostnames to IP addresses for local name resolution and has no relationship to user or group account management.

D/etc/group_membership file

/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

#Linux administration#user management#group membership#/etc/group

Community Discussion

No community discussion yet for this question.

Full SK0-004 Practice