CompTIA XK0-005 Practice Test
Prepare smarter and boost your chances of success with our CompTIA XK0-005 Practice test. This test helps you assess your knowledge, pinpoint strengths, and target areas for improvement. Surveys and user data from multiple platforms show that individuals who use XK0-005 practice exam are 40–50% more likely to pass on their first attempt.
Start practicing today and take the fast track to becoming CompTIA XK0-005 certified.
14760 already prepared
Updated On : 3-Nov-2025476 Questions
4.8/5.0
What is the main objective when using Application Control?
A. To filter out specific content.
B. To assist the firewall blade with handling traffic.
C. To see what users are doing.
D. Ensure security and privacy of information.
Explanation:
The main objective of using Application Control in a security context (e.g., on a Linux system or network appliance) is to ensure the security and privacy of information. Application Control allows administrators to monitor, restrict, or allow specific applications or application features based on security policies. This helps prevent unauthorized applications from running, reduces the risk of malware or data leaks, and ensures compliance with security standards by controlling how applications handle data.
Why not the other options?
A. To filter out specific content:
While Application Control can filter certain types of content (e.g., blocking file uploads in an app), this is a secondary function. Its primary goal is broader security and policy enforcement, not just content filtering.
B. To assist the firewall blade with handling traffic:
Application Control may integrate with firewalls to manage traffic, but it is not primarily designed to assist the firewall. Its focus is on application-level control, not general traffic management.
C. To see what users are doing:
Monitoring user activity is a byproduct of Application Control (e.g., logging app usage), but the main objective is to enforce security and privacy, not just visibility.
References:
CompTIA XK0-005 Objective:
4.1 (Given a scenario, implement and configure security features) – Relates to controlling application behavior for security.
General Security Practice:
Application Control is widely documented in frameworks like CIS Controls (Control 2: Inventory and Control of Software Assets) and NIST SP 800-53.
A Linux administrator has logged in to a server for the first time and needs to know which services are allowed through the firewall. Which of the following options will return the results for which the administrator is looking?
A. firewall-cmd —get-services
B. firewall-cmd —check-config
C. firewall-cmd —list-services
D. systemctl status firewalld
Explanation:
The firewall-cmd --list-services command is used to display the list of services that are currently allowed through the firewall in the default zone (or a specified zone). This directly answers the question, "which services are allowed through the firewall?"
For example,
the output might look like this:
text
ssh dhcpv6-client cockpit
This indicates that incoming connections for the ssh, dhcpv6-client, and cockpit services are permitted.
Analysis of Incorrect Options
A. firewall-cmd --get-services:
This command lists all the pre-defined service names that are available to be added to a zone. It does not show which ones are currently allowed; it just shows the full catalog of services that firewalld knows about (e.g., ssh, http, https, samba). This is not what the administrator needs.
B. firewall-cmd --check-config:
This command checks the firewalld configuration for any errors. It is a validation tool used to ensure the configuration files are syntactically correct. It does not list the active firewall rules or allowed services.
D. systemctl status firewalld:
This command checks the state of the firewalld daemon itself—whether it is running, enabled, and some high-level log messages. It does not provide a list of the services that are allowed through the firewall.
Reference:
Command:
firewall-cmd - The command-line client for the firewalld daemon.
Concept:
Managing firewalld zones and services. The --list-services flag is the primary tool for quickly auditing which services are permitted in the current runtime configuration. To see the permanent configuration (which will be active after a reload/reboot), you would use firewall-cmd --list-services --permanent.
A Linux administrator needs to create an image named sda.img from the sda disk and store it in the /tmp directory. Which of the following commands should be used to accomplish this task?
A. dd of=/dev/sda if=/tmp/sda.img
B. dd if=/dev/sda of=/tmp/sda.img
C. dd --if=/dev/sda --of=/tmp/sda.img
D. dd --of=/dev/sda --if=/tmp/sda.img
Summary:
The task requires creating a bit-for-bit copy (an image) of an entire disk (/dev/sda) and saving it as a file (/tmp/sda.img). The dd command is the standard tool for this. The key is understanding its syntax: if specifies the input file (the source to read from), and of specifies the output file (the destination to write to).
Correct Option:
B. dd if=/dev/sda of=/tmp/sda.img: This command is correctly structured.
if=/dev/sda sets the input source as the entire sda disk.
of=/tmp/sda.img sets the output destination as the file sda.img in the /tmp directory.
This will read every block from /dev/sda and write it to the image file.
Incorrect Options:
A. dd of=/dev/sda if=/tmp/sda.img:
This command is reversed. It would attempt to read from the /tmp/sda.img file and write it to the /dev/sda disk. This would overwrite and destroy the disk's contents with the data from the file, which is the opposite of creating a backup image.
C. dd --if=/dev/sda --of=/tmp/sda.img:
The dd command uses if= and of= as its parameters, not --if and --of. The double-dash syntax is incorrect and will cause the command to fail.
D. dd --of=/dev/sda --if=/tmp/sda.img:
This command uses the incorrect double-dash syntax and is also logically reversed, which would result in data destruction as explained in option A.
Reference:
Linux man-pages project (dd): The official documentation explains the syntax and parameters for the dd command.
A systems administrator is tasked with creating a cloud-based server with a public IP address.

Which of the following technologies did the systems administrator use to complete this task?
A. Puppet
B. Git
C. Ansible
D. Terraform
Explanation:
The task involves creating a cloud-based server with a public IP address, as shown in the provided configuration snippet. This snippet uses a declarative syntax with parameters like name, key_name, vpc_subnet_id, instance_type, assign_public_ip, image_id, and tags, which is indicative of Terraform. Terraform, an Infrastructure as Code (IaC) tool by HashiCorp, uses HashiCorp Configuration Language (HCL) to provision and manage cloud resources, such as launching an AWS EC2 instance with assign_public_ip: true to ensure a public IP is assigned. The image_id: ami-1234568 further suggests an AWS environment, which Terraform supports natively.
Why not the other options?
A. Puppet:
Puppet is a configuration management tool focused on managing system states (e.g., package installation, file configuration) after provisioning. It does not provision infrastructure or assign public IPs, making it unsuitable for this task.
B. Git:
Git is a version control system for tracking code changes. While it can store Terraform configurations, it does not provision servers or handle public IP assignments, rendering it irrelevant here.
C. Ansible:
Ansible is an automation and configuration management tool that can provision infrastructure using modules like ec2. However, its syntax relies on YAML playbooks, not the HCL block structure shown, which aligns with Terraform.
References:
CompTIA XK0-005 Objective:
3.2 (Given a scenario, manage cloud and virtualization technologies) – Addresses IaC tools like Terraform for cloud resource management.
Terraform Documentation:
Terraform AWS Provider – Details Terraform’s capability to create EC2 instances with public IPs.
AWS Documentation:
EC2 Public IP – Confirms public IP assignment in AWS, supported by Terraform.
A Linux administrator needs to analyze a failing application that is running inside a container. Which of the following commands allows the Linux administrator to enter the running container and analyze the logs that are stored inside?
A. docker run -ti app /bin/sh
B. podman exec -ti app /bin/sh
C. podman run -d app /bin/bash
D. docker exec -d app /bin/bash
Explanation:
The requirement is to enter a running container to analyze its internal logs. The key phrase is "running container," which necessitates using the exec command. The exec command is used to run a new command inside a container that is already active.
podman:
The container runtime (Podman is a common daemonless alternative to Docker, but the command syntax is very similar for this purpose).
exec:
This is the critical part of the command, as it executes a command within a running container.
-ti:
This combination of flags allocates a pseudo-TTY (-t) and keeps STDIN open (-i), allowing for an interactive shell session inside the container.
app:
This is the name or ID of the running container.
/bin/sh:
This is the shell command that will be executed inside the container, giving the administrator an interactive prompt.
Once inside the container using this command, the administrator can navigate the container's filesystem and examine the log files directly.
Analysis of Incorrect Options
A. docker run -ti app /bin/sh:
This command is incorrect because it uses run. The docker run command creates and starts a new container from an image, it does not attach to an existing, already-running container. This would start a second, separate instance of the application, not allow analysis of the failing one.
C. podman run -d app /bin/bash:
This command is also incorrect because it uses run. Furthermore, the -d flag runs the new container in detached mode (in the background), which is the opposite of what is needed for interactive analysis. This would create a new container, not interact with the existing, failing one.
D. docker exec -d app /bin/bash:
This command uses the correct exec verb but includes the -d flag, which runs the command in detached mode. This would start a shell inside the running container but immediately send it to the background, preventing the administrator from interacting with it. The administrator would not be "entering" the container; the shell would run invisibly and then exit.
Reference:
Commands:
podman exec / docker exec
Concept:
Container troubleshooting and interaction. The fundamental distinction between container run (create a new container) and container exec (run a command in an existing container) is essential for effectively managing and debugging containerized applications. The -it flags are standard for obtaining an interactive shell session.
A Linux administrator is creating a primary partition on the replacement hard drive for an application server. Which of the following commands should the administrator issue to verify the device name of this partition?
A. sudo fdisk /dev/sda
B. sudo fdisk -s /dev/sda
C. sudo fdisk -l
D. sudo fdisk -h
Explanation:
The administrator's goal is to verify the device name of a newly created partition (e.g., /dev/sda1). The fdisk -l command is specifically designed for this purpose. When executed, it performs a non-interactive scan of the system's storage devices and prints a comprehensive listing of the partition tables for all recognized disks. This output includes critical details such as the disk device (/dev/sda), the partition devices (/dev/sda1, /dev/sda2), their sizes, start and end sectors, and the partition type. By running sudo fdisk -l, the administrator can immediately see an overview of the entire storage configuration, confirm the presence of the new partition on the replacement drive, and, most importantly, identify its exact assigned device name. This step is essential before proceeding to format the partition with a filesystem.
Analysis of Incorrect Options
A. sudo fdisk /dev/sda:
This command is incorrect because it launches the fdisk utility in interactive mode for the disk /dev/sda. Instead of providing a read-out of existing partitions, it presents a command menu within the utility, waiting for user input to perform actions like creating or deleting partitions. This is the command used to create the partition, not to verify its name post-creation. It does not fulfill the verification requirement.
B. sudo fdisk -s /dev/sda:
This command is not suitable for the task. The -s option is used to display the size of a partition or device in blocks. If given a whole disk like /dev/sda, it would typically return the total capacity of the disk in a single number. It provides no information about the partition layout, partition names, or their individual attributes, making it useless for verifying the device name of a specific partition.
D. sudo fdisk -h:
This command is entirely unrelated to inspecting the disk. The -h flag is a standard convention in many Linux commands to display the help message. Executing fdisk -h will print a list of available command-line options and a brief description of their functions. It does not interact with any storage hardware or return any information about the system's disks or partitions.
Reference
Command: fdisk -l
Concept:
Disk and Partition Management. The ability to verify disk configuration is a fundamental system administration skill. The fdisk -l command is the classic tool for this task for MBR partition tables. For modern systems using GPT, the gdisk -l command is its equivalent, and parted -l provides a similar, more verbose output for both schemes. The core principle is using a listing command (-l) to non-destructively inspect the disk configuration, as opposed to an interactive command that modifies it.
A cloud engineer needs to block the IP address 192.168.10.50 from accessing a Linux server. Which of the following commands will achieve this goal?
A. iptables -F INPUT -j 192.168.10.50 -m DROP
B. iptables -A INPUT -s 192.168.10.30 -j DROP
C. iptables -i INPUT --ipv4 192.168.10.50 -z DROP
D. iptables -j INPUT 192.168.10.50 -p DROP
Explanation:
A cloud engineer needs to block the IP address 192.168.10.50 from accessing a Linux server, which requires configuring the firewall using iptables. The correct command is B. iptables -A INPUT -s 192.168.10.50 -j DROP. This command appends (-A) a rule to the INPUT chain, targeting traffic from the source IP (-s 192.168.10.50), and drops it (-j DROP). This effectively prevents any incoming connections from that IP, meeting the requirement for access control on the server.
Why not the other options?
A. iptables -F INPUT -j 192.168.10.50 -m DROP:
The -F flag flushes all rules in the INPUT chain, which clears existing configurations rather than adding a block rule. The syntax -j 192.168.10.50 is invalid; the jump target should be DROP, not an IP.
C. iptables -i INPUT --ipv4 192.168.10.50 -z DROP:
This option contains errors. There’s no -i INPUT (possibly a typo for -I to insert) or --ipv4 flag in iptables. The -z option is nonexistent; it should be -j for the target action like DROP.
D. iptables -j INPUT 192.168.10.50 -p DROP:
The syntax is incorrect. The -j flag requires a target (e.g., DROP) after the chain (e.g., INPUT), and -p specifies a protocol, not a drop action. The order and structure do not align with valid iptables usage.
Additional Steps
To ensure the rule persists after a reboot, save it with iptables-save > /etc/iptables/rules.v4 and restore it using a script or systemd service. Verify the rule with iptables -L -v -n.
References|:
CompTIA XK0-005 Objective:
2.3 (Configure firewall settings using iptables or nftables) – Covers basic firewall rule creation.
iptables Documentation:
iptables Man Page – Provides details on INPUT, -A, -s, and -j DROP syntax.
Linux Security Guide:
Red Hat Enterprise Linux 8 Security Guide – Discusses firewall configuration with iptables.
Which of the following tools is BEST suited to orchestrate a large number of containers across many different servers?
A. Kubernetes
B. Ansible
C. Podman
D. Terraform
Summary:
The requirement is to manage a "large number of containers across many different servers." This describes the core function of container orchestration: automating the deployment, scaling, networking, and management of containerized applications across a cluster of machines. The best tool is one designed specifically for this complex, dynamic, and scalable workload.
Correct Option:
A. Kubernetes:
This is the industry-standard container orchestration platform. It is specifically designed to automate the deployment, scaling, and operations of application containers across clusters of hosts. It provides mechanisms for service discovery, load balancing, storage orchestration, automated rollouts and rollbacks, and self-healing (e.g., restarting failed containers), making it ideal for managing large-scale containerized applications.
Incorrect Options:
B. Ansible:
Ansible is a powerful configuration management and automation tool. It is excellent for automating software provisioning, configuration, and application deployment to servers. While it can install and start containers (e.g., via Podman or Docker), it is not a native orchestration platform. It lacks the built-in, dynamic scheduling, scaling, and self-healing capabilities that Kubernetes provides for a container-centric environment.
C. Podman:
Podman is a daemonless container engine for developing, managing, and running OCI Containers. It is a direct alternative to Docker for running containers on a single host. It does not provide clustering or orchestration features to manage containers across multiple servers.
D. Terraform:
Terraform is an Infrastructure as Code (IaC) tool. It is used to provision and manage the underlying cloud infrastructure (e.g., virtual machines, networks, storage) on which containers will run. It can be used to set up a Kubernetes cluster, but it is not the tool used for the day-to-day orchestration of the containers themselves within that cluster.
Reference:
Official CompTIA Linux+ (XK0-005) Certification Exam Objectives: This knowledge aligns with the container management concepts in Objective 1.5. Understanding the distinction between a container engine (Podman/Docker), a configuration management tool (Ansible), an infrastructure provisioning tool (Terraform), and a dedicated orchestrator (Kubernetes) is crucial for designing modern application infrastructure.
An administrator is trying to diagnose a performance issue and is reviewing the following output:

System Properties:
CPU: 4 vCPU
Memory: 40GB
Disk maximum IOPS: 690
Disk maximum throughput: 44Mbps | 44000Kbps
Based on the above output, which of the following BEST describes the root cause?
A. The system has reached its maximum IOPS, causing the system to be slow
B. The system has reached its maximum permitted throughput, therefore iowait is increasing.
C. The system is mostly idle, therefore the iowait is high.
D. The system has a partitioned disk, which causes the IOPS to be doubled.
Summary:
The system is experiencing high iowait (97.09%), indicating that processes are frequently blocked waiting for input/output (disk) operations to complete. The performance data shows the disk's maximum throughput is 44Mbps (44000Kbps). The iostat output reveals the disk (vda) is achieving a throughput of 43.99Mbps, which is extremely close to the disk's maximum capacity. This saturation is the bottleneck causing high iowait and system slowness.
Correct Option:
B. The system has reached its maximum permitted throughput, therefore iowait is increasing:
This is the most accurate description. The disk is operating at its maximum throughput limit (~44Mbps). When a disk cannot read or write data any faster, processes that need to perform I/O are forced to wait in a queue, which the CPU reports as iowait time. The system is slow because the disk is the bottleneck.
Incorrect Options:
A. The system has reached its maximum IOPS, causing the system to be slow:
The iostat output shows the disk is performing 66.66 reads per second and 3.33 writes per second, totaling ~70 IOPS. This is well below the disk's maximum of 690 IOPS, so IOPS is not the limiting factor.
C. The system is mostly idle, therefore the iowait is high:
This misinterprets the iostat output. A high %iowait does not mean the system is idle; it means the CPUs are idle specifically because they are waiting for the blocked I/O operations to finish. The system is not idle by choice but is stalled due to the disk bottleneck.
D. The system has a partitioned disk, which causes the IOPS to be doubled:
There is no evidence of a disk partition issue in the output. The throughput is the clear and measurable bottleneck.
Reference:
Linux man-pages project (iostat): The official documentation explains the output metrics, including %iowait and wkB/s (write KB per second), which can be converted to throughput.
A systems administrator is tasked with installing GRUB on the legacy MBR of the SATA hard drive. Which of the following commands will help the administrator accomplish this task?
A. grub-install /dev/hda
B. grub-install /dev/sda
C. grub-install /dev/sr0
D. grub-install /dev/hd0,0
Explanation:
The question specifies installing GRUB on a legacy MBR of a SATA hard drive. In the Linux device naming scheme, SATA, SCSI, and USB storage devices are designated as sdX, where "X" is a letter starting from 'a'. The first SATA drive is /dev/sda. The grub-install command is used to install the GRUB bootloader onto a specific device. When given the target of /dev/sda, it writes the necessary bootloader code (the first stage) directly to the Master Boot Record (MBR) of the first SATA disk. This is the standard and correct procedure for installing GRUB to the MBR of the primary SATA drive, ensuring the system can boot.
Analysis of Incorrect Options
A. grub-install /dev/hda:
This command targets the first IDE/PATA hard drive under the legacy Linux device naming convention. However, the question explicitly states the hardware is a SATA drive. SATA drives use the /dev/sdX scheme, not /dev/hdX. Using this command would fail if no IDE drive named /dev/hda exists, and it would not install GRUB to the correct SATA drive.
C. grub-install /dev/sr0:
This device, /dev/sr0, refers to the first SCSI CD-ROM device, which is typically a CD/DVD drive. Installing a bootloader meant for a hard drive to a optical drive is incorrect and would not work. The bootloader needs to be installed on the primary bootable storage device, which is the SATA hard drive (/dev/sda), not an optical drive.
D. grub-install /dev/hd0,0:
This syntax is invalid for the grub-install command. The format (hd0,0) is an internal device naming convention used within the GRUB shell or configuration file (grub.cfg), where hd0 refers to the first disk and ,0 refers to the first partition. The grub-install command requires a Linux device file (e.g., /dev/sda), not GRUB's internal notation. This command would result in an error.
Reference:
Command: grub-install
Concept:
Bootloader Management. A critical system administration task is understanding the difference between the disk device (/dev/sda) and its partitions (/dev/sda1). The MBR is located on the disk itself, not within a partition. Therefore, grub-install must target the whole disk (/dev/sda) to correctly write to the MBR. Furthermore, knowing the modern device naming scheme (sdX for SATA/SCSI) versus the legacy one (hdX for IDE) is essential for targeting the correct hardware.
| Page 2 out of 48 Pages |
| XK0-005 Practice Test |