Courseiva
Manage users and groupsmediumMultiple SelectObjective-mapped

EX200 Manage users and groups Practice Question

Which TWO commands can be used to add a user to a secondary group without removing existing supplementary group memberships? (Choose exactly 2)

⚠ Common exam trap

Candidates often confuse `usermod -G` (which replaces all supplementary groups) with `usermod -aG` (which appends), and may also mistakenly think `groupadd` or `adduser` can modify group memberships, when in fact only `usermod -aG` and `gpasswd -a` are the correct tools for this task.

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 -aG group user

`usermod -aG` appends the user to the specified supplementary group(s) without affecting any existing supplementary group memberships. The `-a` flag (append) must be used with `-G` to avoid overwriting the current list of supplementary groups. This is the standard method in Red Hat Enterprise Linux for adding a user to an additional group while preserving all other group memberships.

Answer analysis

Option-by-option breakdown

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

  • usermod -aG group user

    Why this is correct

    The `-a` flag in `usermod -aG group user` is the critical component: it stands for 'append', meaning the specified user is added to the supplementary group listed after `-G` without removing the user from any existing supplementary groups. Omitting `-a` would replace the user's entire supplementary group membership list with just the one group, which can unexpectedly strip access to other groups. This command directly edits /etc/group and /etc/passwd to update group membership.

  • usermod -AG group user

    Why it's wrong here

    `-A` is not a valid option for the `usermod` command on Linux; it is not recognized and will produce an error. Even if a system or a future version tried to interpret it, the absence of the lowercase `-a` means the intended 'append' behavior is lost, so the command would either fail outright or, in some permissive parsers, be treated as `-a` plus `-G` but without the proper flag combination. The correct syntax to append to supplementary groups is `usermod -aG`, with `-a` lowercase and immediately paired with `-G`.

  • adduser user group

    Why it's wrong here

    The `adduser` utility is a friendly interactive wrapper for `useradd`, and its primary purpose is to create new user accounts, not to modify the group memberships of an existing user. Its argument syntax does not accept `user group` as a way to assign group membership; doing so would be interpreted as specifying a new username with a non-existent 'group' option, or it would simply fail with an error. To add a user to a secondary group, you must use a dedicated group management command like `usermod -aG` or `gpasswd -a`.

  • gpasswd -a user group

    Why this is correct

    The `gpasswd -a user group` command uses the `-a` (add) flag to append a user to a specified group, and it is an official alternative to `usermod -aG` for modifying supplementary group membership. Unlike directly editing /etc/group, `gpasswd` handles the atomic update of group files and works correctly even if the group file is large. This command preserves all other group memberships of the user, only adding the named group.

  • groupadd -a user group

    Why it's wrong here

    The `groupadd` command is designed exclusively for creating new groups in /etc/group, not for adding users to existing groups. The `-a` flag is not a valid option for `groupadd`, and even if it were, the syntax `groupadd -a user group` would be misinterpreted as placing 'user' in a group-creating context, which is completely nonsensical. To add a user to a group, the correct utilities are `gpasswd -a` or `usermod -aG`, both of which explicitly operate on existing users and groups.

About these practice questions

This EX200 question is part of Courseiva's 127-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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.