nerdexam
CompTIA

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.

Administrative Tasks

Question

Which of the following files assigns a user to its primary group?

Options

  • A/etc/pgroup
  • B/etc/shadow
  • C/etc/group
  • D/etc/passwd
  • E/etc/gshadow

How the community answered

(36 responses)
  • A
    3% (1)
  • D
    94% (34)
  • E
    3% (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.

A/etc/pgroup

/etc/pgroup is not a standard Linux file used for primary group assignment.

B/etc/shadow

The /etc/shadow file stores encrypted user passwords and password aging information, not primary group assignments.

C/etc/group

The /etc/group file lists groups and their members (supplementary groups), but the primary group assignment for a user is defined in /etc/passwd.

D/etc/passwdCorrect

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.

E/etc/gshadow

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

#/etc/passwd#primary group#user management#group assignment

Community Discussion

No community discussion yet for this question.

Full LX0-104 Practice