Free CompTIA Linux+ Services and User Management Practice Test 2026 — XK0-005 Questions
This free CompTIA Linux+ Services and User Management practice test covers user and group management, systemctl, journalctl, package managers (dnf/apt/rpm), cron, systemd timers, NFS, SMB, and Linux logging. Each question includes a detailed explanation with Linux command-line context — perfect for XK0-005 exam prep.
Key Topics in CompTIA Linux+ Services and User Management
- useradd / usermod
- systemctl & journalctl
- dnf / apt / rpm
- cron & systemd timers
- NFS & SMB
- Logging
6 Free CompTIA Linux+ Services and User Management Practice Questions with Answers
Each question below includes 4 answer options, the correct answer, and a detailed explanation. These are real questions from the FlashGenius CompTIA Linux+ XK0-005 question bank for the Services and User Management domain (16% of the exam).
Sample Question 1 — Services and User Management
Which command would you use to change the default runlevel on a CentOS 7 system?
- A. systemctl set-default multi-user.target (Correct answer)
- B. systemctl isolate graphical.target
- C. systemctl enable multi-user.target
- D. systemctl start multi-user.target
Correct answer: A
Explanation: The command 'systemctl set-default multi-user.target' is used to change the default runlevel on a systemd-based system like CentOS 7. 'systemctl isolate' would change the current runlevel but not set the default. 'systemctl enable' is used for enabling services, and 'systemctl start' is used to start services, not change runlevels.
Sample Question 2 — Services and User Management
On a RHEL server, you need to create a new user that should not have a home directory. Which command would achieve this?
- A. useradd -M newuser (Correct answer)
- B. useradd -m newuser
- C. useradd --home /dev/null newuser
- D. useradd -N newuser
Correct answer: A
Explanation: The 'useradd -M' command creates a new user without creating a home directory. The '-m' option creates a home directory, '--home /dev/null' would set the home directory to /dev/null, which is not a typical or recommended location, and '-N' is not a valid option for this purpose.
Sample Question 3 — Services and User Management
You are managing a cloud-based Ubuntu server and need to ensure that the SSH service starts on boot. Which command should you use?
- A. systemctl enable ssh (Correct answer)
- B. systemctl start ssh
- C. service ssh enable
- D. chkconfig ssh on
Correct answer: A
Explanation: 'systemctl enable ssh' will ensure that the SSH service starts on boot in systems using systemd, like Ubuntu. 'systemctl start ssh' starts the service immediately but does not enable it on boot. 'service ssh enable' and 'chkconfig ssh on' are not valid commands for enabling services on boot in Ubuntu.
Sample Question 4 — Services and User Management
A user reports they cannot access a web application hosted in a Docker container on a SUSE server. You suspect the container is not running. What command would you use to verify the container's status?
- A. docker ps (Correct answer)
- B. docker inspect
- C. docker status
- D. docker run
Correct answer: A
Explanation: The 'docker ps' command lists all running containers, which allows you to verify if the container is running. 'docker inspect' provides detailed information about a container but does not directly show running status. 'docker status' is not a valid Docker command, and 'docker run' is used to start a new container.
Sample Question 5 — Services and User Management
You need to add a user to the 'docker' group on a CentOS system to allow them to manage Docker containers without root privileges. Which command should you use?
- A. usermod -aG docker username (Correct answer)
- B. groupadd -a docker username
- C. gpasswd -a username docker
- D. adduser username docker
Correct answer: A
Explanation: 'usermod -aG docker username' appends the user to the 'docker' group, which is the correct way to add a user to a group without removing them from other groups. 'groupadd -a' is not a valid command, 'gpasswd -a username docker' is also correct but less commonly used, and 'adduser username docker' is incorrect syntax for adding a user to a group.
Sample Question 6 — Services and User Management
A user claims they cannot log into a hybrid cloud environment using SSH. You suspect their account is locked. Which command would you use to verify this on an Ubuntu server?
- A. passwd -S username (Correct answer)
- B. passwd -l username
- C. usermod -L username
- D. chage -l username
Correct answer: A
Explanation: 'passwd -S username' displays the status of the user's account, including whether it is locked. 'passwd -l username' locks the account, 'usermod -L username' also locks the account, and 'chage -l username' shows password aging information but does not indicate if the account is locked.
How to Study CompTIA Linux+ Services and User Management
Combine these CompTIA Linux+ Services and User Management practice questions with hands-on labs in a Linux VM (Ubuntu, Rocky, or Fedora). The XK0-005 exam emphasizes practical command-line work, so always test commands in a sandbox — that hands-on muscle memory is what separates passing and failing scores.
About the CompTIA Linux+ XK0-005 Exam
- Questions: 90 max (multiple-choice + performance-based)
- Time: 90 minutes
- Passing score: 720 / 900 (~80%)
- Cost: $369 USD
- Domains: 5 (this is 16% of the exam)
- Validity: 3 years (renewable via CE)
Other CompTIA Linux+ Domains
Start the free CompTIA Linux+ Services and User Management practice test now | 10-question quick start | All CompTIA Linux+ domains | CompTIA Linux+ Cheat Sheet