Courseiva
Manage users and groups →easyMultiple Select

EX200 Manage users and groups Practice Question

Which TWO commands can be used to add a user to an existing supplementary group without removing them from other groups?

⚠ Common exam trap

Candidates often confuse `-g` (primary group) with `-G` (supplementary groups) and forget that `-G` without `-a` overwrites all supplementary group memberships, leading to accidental removal from other groups.

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

✓

usermod -a -G group user

The `usermod -a -G group user` command appends the user to the specified supplementary group without affecting their membership in other groups. The `-a` (append) flag must be used with `-G` to add the user to additional groups; without `-a`, the `-G` option replaces all supplementary group memberships with the listed groups.

Answer analysis

Option-by-option breakdown

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

  • ✗

    groupmod -a user group

    Why it's wrong here

    groupmod is used to alter the properties of an existing group, such as its name or GID, not to manage its member list. In fact, groupmod has no -a option at all; attempting to use it this way would simply produce an invalid option error. Membership changes belong to usermod or gpasswd, so this command cannot add a user to a group.

  • ✓

    usermod -a -G group user

    Why this is correct

    The -a (append) flag, when combined with -G, adds the specified supplementary group to the user's existing set of supplementary groups without disturbing any current memberships. Because -a is required to prevent -G from overwriting the full list, this is the standard, safe method for adding a user to a secondary group. For instance, usermod -a -G wheel alice would let alice retain all her other group memberships while gaining wheel privileges.

  • ✗

    usermod -g group user

    Why it's wrong here

    The lowercase -g option changes the user's primary group, not a supplementary membership. The primary group is the one seen in /etc/passwd and is used as the default group for files the user creates, so altering it can change default ownerships and even break existing permissions. This command does not, however, make the user a member of the specified group as an additional group, which is what the question requires.

  • ✗

    usermod -G group user

    Why it's wrong here

    Using -G without -a replaces the user's entire supplementary group membership with the groups listed on the command line. For example, if the user was already a member of wheel and ftp, running usermod -G group user would strip wheel and ftp and leave only group. This is why -a is essential whenever the intent is to add a group rather than redefine the full set of secondary groups; otherwise the user may lose necessary permissions.

  • ✓

    gpasswd -a user group

    Why this is correct

    gpasswd -a appends the user to the specified group as a supplementary member, so the user's other group memberships are not affected. This command is designed specifically for managing /etc/group entries, making it a clean and focused alternative to usermod -a -G. Because it adds rather than replaces, it is a correct way to achieve the requested outcome.

About these practice questions

One of 427 original EX200 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.