EX200 usermod Practice Question
An administrator wants to add the user 'jane' to the supplementary groups 'wheel' and 'docker' without removing her from other groups. Which command should be used?
⚠ Common exam trap
The exam may include both `-aG` and `-a -G` as options. Both are correct and achieve the append effect. The dangerous trap is choosing `-G` alone (option D), which replaces all existing supplementary 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 -aG wheel,docker jane
Both `usermod -aG wheel,docker jane` and `usermod -a -G wheel,docker jane` are valid commands to append the user to the specified supplementary groups without removing her from other groups. The `-a` (append) flag can be combined with `-G` as `-aG` or provided separately (`-a -G`); both forms work identically. Option D (`usermod -G`) without `-a` would overwrite all supplementary groups, which is incorrect. Option A uses `groupmems`, which is not the standard command for this task and has incorrect syntax.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
groupmems -a jane -g wheel,docker
Why it's wrong here
groupmems is intended for managing the member list of a single named group, and its -g option expects exactly one group name, not a comma-delimited list. Supplying 'wheel,docker' will be interpreted as a single group name, so the command either errors out or silently fails to affect either group. Additionally, groupmems operates on the group's member list rather than a user's supplementary group assignment, making it unsuitable for appending a user to multiple supplementary groups at once.
- ✓
usermod -aG wheel,docker jane
Why this is correct
The -aG form is a compact combined option where -a enables append mode and -G specifies the supplementary group list, so the effect is exactly the same as usermod -a -G. It adds jane to wheel and docker while retaining any other supplementary groups she already has. Although it is less readable than the separated form, it is a fully valid and correct way to accomplish the task.
- ✓
usermod -a -G wheel,docker jane
Why this is correct
Using -a alongside -G directs usermod to append the listed groups to the user's current supplementary groups instead of replacing them. This command explicitly adds jane to both wheel and docker, and because -a is present, all her existing supplementary memberships are left intact. It is the canonical, unambiguous way to satisfy the requirement, and the space between -a and -G is optional but harmless.
- ✗
usermod -G wheel,docker jane
Why it's wrong here
Without the -a append flag, usermod -G replaces the entire supplementary group list for the user with the groups specified. If jane already belongs to any other supplementary groups (for example, a shared project group), those memberships will be removed, leaving her in only wheel and docker. This violates the stated requirement to add her to wheel and docker while preserving existing group memberships, so the command is incorrect.
Go deeper
Related to this question
About these practice questions
One of 127 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 →
Same concept, more angles
1 more way this is tested on EX200
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. Which TWO commands can be used to add the user 'alice' to the supplementary group 'developers'?
medium- ✓ A.gpasswd -a alice developers
- B.useradd -g developers alice
- ✓ C.usermod -aG developers alice
- D.groupmod -a alice developers
- E.usermod -g developers alice
Why A: `gpasswd -a alice developers` adds the user 'alice' to the supplementary group 'developers' by appending her to the group's member list in /etc/group. Option C is correct because `usermod -aG developers alice` appends 'alice' to the supplementary group 'developers' without removing her from other supplementary groups, which is the intended behavior for adding a user to an additional group.
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.