XK0-006 System Management Practice Question
A Linux administrator needs to create a new user account 'jdoe' with a home directory /home/jdoe and the default shell /bin/bash. Which command will accomplish this?
⚠ Common exam trap
Watch out — candidates often confuse useradd with usermod or groupadd, or assuming adduser is universally available with the same options across all distributions.
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 jdoe
The useradd command with -m creates the home directory and -s sets the shell. This is the standard non-interactive method to create a user with specific home and shell. The other commands either modify existing users, create groups, or are distribution-specific interactive tools that may not accept the given options.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
groupadd -m -s /bin/bash jdoe
Why it's wrong here
groupadd creates a new group, not a user. The options -m and -s are not valid for groupadd (groupadd does not have -m or -s in standard usage). This command would either error out or create a group named jdoe, which does not satisfy the requirement to create a user account with a home directory and shell.
- ✗
adduser jdoe --home /home/jdoe --shell /bin/bash
Why it's wrong here
adduser is a higher-level interactive script on some distributions (like Debian/Ubuntu), but its options and behavior vary. On many systems, adduser does not support --home or --shell in the same way, and it may prompt interactively. While it can create users, it is not the standard low-level command for scripted, non-interactive user creation with specific home and shell.
- ✓
useradd -m -s /bin/bash jdoe
Why this is correct
useradd creates a new user. The -m option creates the home directory (typically /home/jdoe) and copies skeleton files. The -s option sets the login shell to /bin/bash. This command creates the account with the specified home directory and shell, meeting all requirements.
- ✗
usermod -d /home/jdoe -s /bin/bash jdoe
Why it's wrong here
usermod modifies an existing user account; it does not create a new one. If the user jdoe does not exist, this command will fail. Even if the user existed, usermod -d changes the home directory path but does not create it unless -m is also used. This command is incorrect for creating a new user.
Go deeper
Related to this question
Learn chapter
Linux Fundamentals and History
Key term
User
A user is any person, system, or device that interacts with an IT service, resource, or identity system, typically authenticated through credentials and authorized to perform specific actions.
Key term
Bash
Bash is a command-line interpreter that lets users interact with an operating system by typing text commands instead of clicking icons.
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.