PT0-002 Attacks and Exploits Practice Question
A penetration tester has compromised a Linux web server and wants to maintain persistent access by creating a new user account with a known password. The tester has root privileges. Which of the following commands will create a new user named 'support' with a home directory and a bash shell?
⚠ Common exam trap
Test-takers frequently confuse user creation with user modification, or assuming that adduser and useradd are interchangeable across all Linux 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 support
The useradd command with -m and -s creates a new user with a home directory and specified shell. This is the standard low-level utility available on most Linux distributions. After creating the account, the tester would set a password using passwd. The other commands either modify existing users, use non-standard syntax, or are for password management only, making them unsuitable for creating a new persistent account.
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 support
Why this is correct
The useradd command creates a new user. The -m flag ensures a home directory is created, and -s /bin/bash sets the login shell to bash. This matches the requirement to create a user with a home directory and bash shell. After running this, the tester would set a password with passwd support. This is the standard and correct way to add a user on most Linux distributions.
- ✗
passwd support --create --home /home/support --shell /bin/bash
Why it's wrong here
The passwd command is used to change passwords for existing users. It does not create user accounts and does not accept --create, --home, or --shell options. This command would either error out or misinterpret the arguments. It is entirely incorrect for creating a new user and would not provide the desired persistent access.
- ✗
adduser support --shell /bin/bash --home /home/support
Why it's wrong here
The adduser command is a higher-level interactive script on Debian-based systems. While it can create a user with a home directory and shell, the syntax shown is not universally correct and may prompt interactively. On many systems, adduser does not accept --shell or --home flags in that manner. It is less portable and not the most direct command for scripted user creation, making it less reliable here.
- ✗
usermod -aG support -d /home/support -s /bin/bash
Why it's wrong here
usermod modifies an existing user account; it does not create a new one. The -aG option adds the user to a group, -d changes the home directory, and -s changes the shell. Since the user 'support' does not yet exist, this command will fail with an error. It is the wrong tool for creating a new account and would not achieve the persistence goal.
Go deeper
Related to this question
About these practice questions
One of 777 original PT0-003 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 →
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 PT0-003 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 PT0-003 exam.