XK0-006 System Management Practice Question
A Linux administrator needs to create a new user account 'analyst' with a home directory at /home/analyst and the default shell set to /bin/bash. The user should also be added to the existing supplementary group 'research'. Which command will accomplish this in a single step?
⚠ Common exam trap
Test-takers frequently confuse the -g option (primary group) with -G (supplementary groups), which can lead to incorrect group membership.
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
✓
useradd -m -s /bin/bash -G research analyst
The useradd command with -m creates the home directory, -s specifies the shell, and -G adds the user to supplementary groups. This single command meets all specified conditions without extra steps, making it the correct solution.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
useradd -m -s /bin/bash -G research analyst
Why this is correct
The useradd command with -m creates the home directory, -s sets the login shell, and -G adds the user to the supplementary group 'research'. This single command fulfills all requirements without additional steps, making it the correct choice.
- ✗
groupadd research && useradd -m -s /bin/bash -g research analyst
Why it's wrong here
This command first creates the group 'research' and then adds the user with -g setting the primary group to 'research'. However, the requirement is to add the user to an existing supplementary group, not create a new primary group. The -g flag sets the primary group, which is incorrect here.
- ✗
usermod -m -s /bin/bash -G research analyst
Why it's wrong here
usermod modifies an existing user account; it cannot create a new user. Using usermod with -m attempts to move the home directory, but the user 'analyst' does not exist yet, so this command will fail. Therefore, it is not suitable for creating a new account.
- ✗
adduser analyst -m -s /bin/bash -g research
Why it's wrong here
The adduser command is a higher-level interactive tool, but its syntax for group specification differs; -g sets the primary group, not supplementary. Also, adduser may not support all these flags in non-interactive mode, and it is not the standard low-level command, so it fails to meet the requirement in one step accurately.
Go deeper
Related to this question
Learn chapter
Advanced Shell Scripting and Automation
Key term
Linux
Linux is an open-source operating system that manages computer hardware and software, widely used in servers, desktops, and embedded systems.
Key term
useradd
A command-line utility in Unix-like operating systems used to create a new user account with specified settings.
About these practice questions
Courseiva writes every XK0-006 question from scratch — 781 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 and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official CompTIA exam blueprint
This XK0-006 practice question is part of Courseiva's free CompTIA 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 XK0-006 exam.