nerdexam
Linux_Foundation

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.

Submitted by kevin_r· Apr 18, 2026User and Group Management

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

(23 responses)
  • C
    9% (2)
  • D
    87% (20)
  • E
    4% (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.

A/etc/pgroup

`/etc/pgroup` is not a standard file for managing primary groups in Linux.

B/etc/shadow

`/etc/shadow` stores encrypted passwords and password expiration information, not primary group assignment.

C/etc/group

`/etc/group` defines group names and their members (supplementary groups), but the primary group assignment for a user is listed in `/etc/passwd`.

D/etc/passwdCorrect

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.

E/etc/gshadow

`/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

#User Management#Groups#Primary Group#/etc/passwd

Community Discussion

No community discussion yet for this question.

Full LFCS Practice