LPIC-1 Administrative Tasks Practice Question
A user 'jdoe' already exists. The administrator needs to add 'jdoe' to the 'staff' and 'admin' groups without changing other group memberships. Which command accomplishes this?
⚠ Common exam trap
The trap here is that candidates often forget the `-a` (append) flag with `usermod -G`, assuming `-G` alone adds groups, when in fact it replaces all supplementary group memberships, which is a common cause of accidental privilege removal.
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 staff,admin jdoe
The `usermod -a -G` command appends the user 'jdoe' to the supplementary groups 'staff' and 'admin' without altering existing group memberships. The `-a` (append) flag is essential; without it, `-G` would replace all current supplementary groups with only those listed. This matches the requirement to add the user to new groups while preserving 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 -a -G staff,admin jdoe
Why this is correct
The -a (append) flag with -G adds the user to the listed groups without affecting other group memberships.
- ✗
sed -i 's/^staff:.*/&jdoe/' /etc/group
Why it's wrong here
Directly editing /etc/group is error-prone and not recommended; use usermod instead.
- ✗
usermod -G staff,admin jdoe
Why it's wrong here
Without -a, this overwrites the user's supplementary group list, removing existing groups.
- ✗
useradd -G staff,admin jdoe
Why it's wrong here
useradd is for creating new users; for existing users, usermod should be used.
Go deeper
Related to this question
About these practice questions
Courseiva writes every LPIC-1 question from scratch — 527 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 →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This LPIC-1 practice question is part of Courseiva's free LPI 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 LPIC-1 exam.