102-500 practice question 28 of 30

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

Full set: 233 questions
Answer options
A: /etc/pgroup
B: /etc/shadow
C: /etc/group
D: /etc/passwd Correct answer
E: /etc/gshadow
Correct Answer:
D. /etc/passwd
Explanation

The /etc/passwd file is the primary user account database in Linux. Each line represents a user and contains seven colon-separated fields. The fourth field is the numerical Group ID (GID) of the user's primary group. When a user logs in, their initial group identity is set to this primary group. The group's name can be found by looking up this GID in the /etc/group file.

Why Incorrect

A. /etc/pgroup is not a standard Linux file for user or group management.
B. /etc/shadow stores encrypted passwords and password aging information, not the primary group assignment.
C. /etc/group defines groups and lists their members, but the primary group for a user is set by the GID in /etc/passwd.
E. /etc/gshadow stores secure group information, such as group passwords, not a user's primary group.

References

1. Linux man-pages project. passwd(5) manual page. Section: "DESCRIPTION". It explicitly states the fourth field is "The group ID of the user's initial login group."

2. The Linux Documentation Project (2004). Linux System Administrators' Guide. Section 8.3. "The /etc/passwd file". This section details the structure of the /etc/passwd file, identifying the fourth field as the GID.

3. MIT OpenCourseWare. 6.828: Operating System Engineering course notes. "Lecture 18: Security". The lecture discusses Unix permissions and the role of /etc/passwd in defining UID and primary GID.

Scroll to Top