Courseiva
Manage users and groups →hardMultiple Choice

EX200 Manage users and groups Practice Question

After being added to a new supplementary group with usermod -aG, a user logs out and back in but still cannot access files owned by that group. Which command should the user run to verify current effective group membership?

⚠ Common exam trap

After `usermod -aG`, the new group is only active in new login sessions. To verify if the current shell actually has the group, use `id` (no arguments). Do not use `groups $(whoami)`, because that checks the user's group list from /etc/group and may show the new group even if the current process does not have it.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

id

The `id` command displays the real and effective user/group IDs and all supplementary groups for the current process, making it the correct way to confirm whether the new group is actually active in the current shell. `groups $(whoami)` is incorrect because it uses the username argument, which reads the group membership from the user database (e.g., getgrouplist) and does not necessarily reflect the groups in the current process. This can misleadingly show the new group even if the current shell has not inherited it. `newgrp -c 'groups'` is not standard and is meant for changing the real group ID, not for displaying groups. `usermod -g` modifies group settings and requires superuser privileges, so it does not verify membership.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    newgrp -c 'groups'

    Why it's wrong here

    The `newgrp` command is used to start a subshell with a different group ID, not to list group memberships. The `-c` option is not a valid newgrp option; the command as written is syntactically invalid and would likely fail or launch a shell with unexpected arguments. Even if it were well-formed, newgrp would only change the active group for a new shell, not display any group information.

  • ✓

    id

    Why this is correct

    The `id` command with no arguments reads the kernel's credential data for the current process via getgroups(), displaying the real UID, effective UID, all supplementary GIDs, and, where available, SELinux context. Because it reports actual process credentials rather than performing a database lookup, it is the definitive way to verify which groups your current shell truly belongs to after a group change.

  • ✗

    groups $(whoami)

    Why it's wrong here

    The `groups $(whoami)` command substitutes the current username and asks the group database (e.g., /etc/group) for that user's memberships, which may be cached by NSS. It does not necessarily reflect the supplementary groups of the current process, so after usermod it could show a group that your shell doesn't actually have access to yet, or miss one due to caching. The `id` command, in contrast, shows the kernel-level group list for the current process.

  • ✗

    usermod -g

    Why it's wrong here

    The `usermod -g` option is a privileged administration command that changes a user's primary group in /etc/passwd; it does not query or display any group information. Running it without root privileges fails, and using it for verification would be both dangerous and pointless because it modifies rather than reports. It also only affects the primary group ID, not supplementary group memberships.

About these practice questions

Courseiva writes every EX200 question from scratch — 427 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This EX200 practice question is part of Courseiva's free Red Hat certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the EX200 exam.