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

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?

  1. A. systemctl set-default multi-user.target (Correct answer)
  2. B. systemctl isolate graphical.target
  3. C. systemctl enable multi-user.target
  4. 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?

  1. A. useradd -M newuser (Correct answer)
  2. B. useradd -m newuser
  3. C. useradd --home /dev/null newuser
  4. 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?

  1. A. systemctl enable ssh (Correct answer)
  2. B. systemctl start ssh
  3. C. service ssh enable
  4. 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?

  1. A. docker ps (Correct answer)
  2. B. docker inspect
  3. C. docker status
  4. 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?

  1. A. usermod -aG docker username (Correct answer)
  2. B. groupadd -a docker username
  3. C. gpasswd -a username docker
  4. 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?

  1. A. passwd -S username (Correct answer)
  2. B. passwd -l username
  3. C. usermod -L username
  4. 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

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