{"id":11543,"date":"2026-09-14T10:09:16","date_gmt":"2026-09-14T10:09:16","guid":{"rendered":"https:\/\/www.examlabs.com\/certification\/?p=11543"},"modified":"2026-09-14T10:09:16","modified_gmt":"2026-09-14T10:09:16","slug":"comptia-xk0-006-practice-test-questions-and-exam-dumps-part-20-q381-q400","status":"publish","type":"post","link":"https:\/\/www.examlabs.com\/certification\/comptia-xk0-006-practice-test-questions-and-exam-dumps-part-20-q381-q400\/","title":{"rendered":"CompTIA XK0-006 Practice Test Questions and Exam Dumps Part 20: Q381\u2013Q400"},"content":{"rendered":"<h2><b>View Full\u00a0<a href=\"https:\/\/www.examlabs.com\/xk0-006-exam-dumps\">CompTIA XK0-006 Exam Dumps<\/a>\u00a0and Practice Test Dumps.<\/b><\/h2>\n<p>&nbsp;<\/p>\n<h3><b>Question 381<\/b><\/h3>\n<p><b>Which command can display the current status of a systemd-managed service?<\/b><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">service-check<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">systemctl status<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">systemd-status<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">statusctl<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 2<\/b><\/p>\n<p><b>Explanation<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">systemctl status<\/span><span style=\"font-weight: 400;\"> command shows the current state of a systemd-managed service. It can display whether the service is active, inactive, failed, or running, along with recent log messages and the process ID. This makes it useful during service troubleshooting. Administrators should check the status before restarting or changing a service because the output may reveal the actual reason for failure. Combining service status with <\/span><span style=\"font-weight: 400;\">journalctl<\/span><span style=\"font-weight: 400;\"> often provides additional details about configuration or dependency problems.<\/span><\/p>\n<h3><b>Question 382<\/b><\/h3>\n<p><b>Which command can prevent a systemd service from being started manually or automatically?<\/b><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">systemctl disable<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">systemctl block<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">systemctl mask<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">systemctl lock<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 3<\/b><\/p>\n<p><b>Explanation<\/b><\/p>\n<p><span style=\"font-weight: 400;\">systemctl mask<\/span><span style=\"font-weight: 400;\"> prevents a systemd unit from being started because it creates a link to <\/span><span style=\"font-weight: 400;\">\/dev\/null<\/span><span style=\"font-weight: 400;\">. This is stronger than simply disabling a service. A disabled service may still be started manually or by another dependency, while a masked service cannot normally be started until it is unmasked. Masking can be useful when an administrator needs to ensure that a problematic or unwanted service cannot run. Administrators should understand the service dependencies before applying a mask.<\/span><\/p>\n<h3><b>Question 383<\/b><\/h3>\n<p><b>Which command reverses a systemd service mask?<\/b><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">systemctl unmask<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">systemctl enable<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">systemctl unlock<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">systemctl release<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 1<\/b><\/p>\n<p><b>Explanation<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">systemctl unmask<\/span><span style=\"font-weight: 400;\"> command removes a systemd service mask. After unmasking, the service can normally be started again, assuming its configuration and dependencies are valid. Unmasking does not automatically enable the service at boot, so administrators may need to separately use <\/span><span style=\"font-weight: 400;\">systemctl enable<\/span><span style=\"font-weight: 400;\"> when automatic startup is required. This distinction is important when restoring a service after troubleshooting. Administrators should check the service status after unmasking to confirm its current state.<\/span><\/p>\n<h3><b>Question 384<\/b><\/h3>\n<p><b>Which command reloads systemd unit files after an administrator creates or changes a service unit?<\/b><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">systemctl refresh<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">systemctl reload-system<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">systemctl daemon-reload<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">systemctl reread<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 3<\/b><\/p>\n<p><b>Explanation<\/b><\/p>\n<p><span style=\"font-weight: 400;\">systemctl daemon-reload<\/span><span style=\"font-weight: 400;\"> tells systemd to reload its unit configuration files. It is commonly required after creating or modifying a service unit file. This command does not restart the service itself. If the service needs to use the new configuration immediately, the administrator may need to restart or reload the service separately. Understanding this difference prevents confusion when a configuration file has been changed but the running service continues using its previous settings.<\/span><\/p>\n<h3><b>Question 385<\/b><\/h3>\n<p><b>Which file contains account information such as usernames, user IDs, and home directories on a typical Linux system?<\/b><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">\/etc\/passwd<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">\/etc\/users<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">\/var\/accounts<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">\/etc\/login.conf<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 1<\/b><\/p>\n<p><b>Explanation<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">\/etc\/passwd<\/span><span style=\"font-weight: 400;\"> file contains basic information about local user accounts. Typical fields include the username, user ID, primary group ID, home directory, and login shell. On modern Linux systems, password hashes are normally stored separately in <\/span><span style=\"font-weight: 400;\">\/etc\/shadow<\/span><span style=\"font-weight: 400;\"> for better security. Administrators may inspect <\/span><span style=\"font-weight: 400;\">\/etc\/passwd<\/span><span style=\"font-weight: 400;\"> when troubleshooting account or login problems. Changes to account files should be made carefully because incorrect entries can prevent users from logging in correctly.<\/span><\/p>\n<h3><b>Question 386<\/b><\/h3>\n<p><b>Which command can lock a user&#8217;s password so that password-based login is disabled?<\/b><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">passwd -l<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">userlock<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">usermod &#8211;stop<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">loginctl lock-user<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 1<\/b><\/p>\n<p><b>Explanation<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">passwd -l<\/span><span style=\"font-weight: 400;\"> command locks a user&#8217;s password by modifying the password information so that the password cannot be used for normal authentication. This can be useful when temporarily disabling an account without deleting it. Locking a password does not necessarily disable every possible authentication method, such as an existing SSH key, depending on the system configuration. Administrators should therefore consider all authentication methods when completely restricting access to an account.<\/span><\/p>\n<h3><b>Question 387<\/b><\/h3>\n<p><b>Which command can show when a user&#8217;s password expires and other password-aging information?<\/b><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">passwd &#8211;status<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">chage -l<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">userage<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">account-info<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 2<\/b><\/p>\n<p><b>Explanation<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">chage -l<\/span><span style=\"font-weight: 400;\"> command displays password-aging information for a user. It can show the last password change, minimum and maximum password age, warning period, and account expiration information. This is useful when troubleshooting login failures caused by expired passwords or account policies. Administrators can use the information to determine whether the user needs to change a password or whether an account has reached an expiration date. Password-aging settings should follow the organization&#8217;s security requirements.<\/span><\/p>\n<h3><b>Question 388<\/b><\/h3>\n<p><b>Which authentication framework provides a common interface for applications to use different authentication methods on Linux?<\/b><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">PAM<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">GRUB<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">LVM<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">SELinux<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 1<\/b><\/p>\n<p><b>Explanation<\/b><\/p>\n<p><span style=\"font-weight: 400;\">PAM, or Pluggable Authentication Modules, provides a common authentication framework used by many Linux applications and services. It allows administrators to configure authentication-related behavior without changing every application individually. PAM can support password policies, account restrictions, session handling, and other authentication functions. Because PAM configuration directly affects user access, administrators should make changes carefully and test them properly. A bad PAM configuration can potentially prevent users, including administrators, from logging in.<\/span><\/p>\n<h3><b>Question 389<\/b><\/h3>\n<p><b>Which security technology provides mandatory access control through security labels and policies on many Linux systems?<\/b><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">ACL<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">SELinux<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">SSH<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">sudo<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 2<\/b><\/p>\n<p><b>Explanation<\/b><\/p>\n<p><span style=\"font-weight: 400;\">SELinux provides mandatory access control using security contexts and policy rules. Unlike traditional Linux permissions, SELinux can restrict what a process is allowed to access even when normal file permissions appear to allow access. This provides an additional security layer for services and applications. When troubleshooting SELinux-related access problems, administrators should examine security contexts and audit messages instead of immediately disabling SELinux. Correctly adjusting policy or contexts is generally safer than removing the security control.<\/span><\/p>\n<h3><b>Question 390<\/b><\/h3>\n<p><b>Which command can display the current SELinux enforcement mode?<\/b><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">selinux-mode<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">getenforce<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">sestatus-mode<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">security-status<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 2<\/b><\/p>\n<p><b>Explanation<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">getenforce<\/span><span style=\"font-weight: 400;\"> command displays the current SELinux mode. The result is normally <\/span><span style=\"font-weight: 400;\">Enforcing<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">Permissive<\/span><span style=\"font-weight: 400;\">, or <\/span><span style=\"font-weight: 400;\">Disabled<\/span><span style=\"font-weight: 400;\">. In enforcing mode, SELinux policy violations are blocked. In permissive mode, violations are logged but generally not blocked. This command is useful when troubleshooting applications that unexpectedly receive permission errors. Administrators should not disable SELinux simply because an application fails; they should first investigate the security context, policy, and relevant audit logs.<\/span><\/p>\n<h3><b>Question 391<\/b><\/h3>\n<p><b>Which command can display the AppArmor profiles currently loaded on a Linux system?<\/b><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">apparmor-status<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">aa-show-status<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">app-profile-list<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">security-profiles<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 1<\/b><\/p>\n<p><b>Explanation<\/b><\/p>\n<p><span style=\"font-weight: 400;\">apparmor-status<\/span><span style=\"font-weight: 400;\"> displays information about loaded AppArmor profiles and their current states. AppArmor uses application-specific security profiles to control what programs are allowed to access. This can help administrators determine whether an application is being restricted by AppArmor. When troubleshooting access problems, administrators should review the relevant profile and logs before disabling the security mechanism. AppArmor and SELinux use different approaches, so the troubleshooting commands and configuration methods also differ.<\/span><\/p>\n<h3><b>Question 392<\/b><\/h3>\n<p><b>Which command can list the active nftables firewall ruleset?<\/b><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">nft show firewall<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">nft list ruleset<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">firewallctl list<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">iptables-nft status<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 2<\/b><\/p>\n<p><b>Explanation<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">nft list ruleset<\/span><span style=\"font-weight: 400;\"> command displays the active nftables ruleset. It is useful when troubleshooting firewall behavior because administrators can inspect tables, chains, and rules that are currently configured. If traffic is unexpectedly blocked or allowed, reviewing the actual ruleset can help identify the relevant rule. Administrators should understand rule order and chain behavior before making changes. Firewall troubleshooting should also consider network routes, service listeners, and application-level configuration.<\/span><\/p>\n<h3><b>Question 393<\/b><\/h3>\n<p><b>Which command can test whether a remote TCP port is reachable without requiring a full application client?<\/b><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">nc<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">tcp-test<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">portping<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">socketcheck<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 1<\/b><\/p>\n<p><b>Explanation<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">nc<\/span><span style=\"font-weight: 400;\"> command, commonly called netcat, can be used to test TCP or UDP connectivity. For example, it can attempt a connection to a specific host and port to determine whether network traffic can reach that destination. This can help separate network connectivity problems from application-specific problems. If the port is reachable but the application still fails, the administrator can focus on the application or protocol. Firewall rules, routing, DNS, and service listeners should also be checked.<\/span><\/p>\n<h3><b>Question 394<\/b><\/h3>\n<p><b>Which command can resolve a hostname using the system&#8217;s configured name-service sources?<\/b><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">host<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">getent hosts<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">resolve-system<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">nameservice<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 2<\/b><\/p>\n<p><b>Explanation<\/b><\/p>\n<p><span style=\"font-weight: 400;\">getent hosts<\/span><span style=\"font-weight: 400;\"> queries the system&#8217;s configured name-service mechanisms to resolve host information. This can be more useful for troubleshooting than using a DNS-only utility because it follows the system&#8217;s configured name-resolution sources, which may include DNS, <\/span><span style=\"font-weight: 400;\">\/etc\/hosts<\/span><span style=\"font-weight: 400;\">, and other mechanisms depending on the configuration. If an application cannot resolve a hostname, administrators can compare <\/span><span style=\"font-weight: 400;\">getent<\/span><span style=\"font-weight: 400;\"> results with tools such as <\/span><span style=\"font-weight: 400;\">dig<\/span><span style=\"font-weight: 400;\"> to determine whether the issue is DNS-specific or related to the system&#8217;s name-service configuration.<\/span><\/p>\n<h3><b>Question 395<\/b><\/h3>\n<p><b>Which file controls the order of hostname lookup sources on many Linux systems?<\/b><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">\/etc\/resolv.conf<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">\/etc\/hosts<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">\/etc\/nsswitch.conf<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">\/etc\/nameorder<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 3<\/b><\/p>\n<p><b>Explanation<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">\/etc\/nsswitch.conf<\/span><span style=\"font-weight: 400;\"> file controls how several types of system information are resolved, including hostname lookup. For example, the <\/span><span style=\"font-weight: 400;\">hosts<\/span><span style=\"font-weight: 400;\"> entry can determine whether the system checks <\/span><span style=\"font-weight: 400;\">\/etc\/hosts<\/span><span style=\"font-weight: 400;\">, DNS, or other sources and in what order. This is important when troubleshooting cases where a hostname resolves differently depending on the tool used. <\/span><span style=\"font-weight: 400;\">\/etc\/resolv.conf<\/span><span style=\"font-weight: 400;\"> mainly provides resolver configuration such as DNS servers, while <\/span><span style=\"font-weight: 400;\">\/etc\/nsswitch.conf<\/span><span style=\"font-weight: 400;\"> determines the broader lookup mechanism.<\/span><\/p>\n<h3><b>Question 396<\/b><\/h3>\n<p><b>Which Git command downloads changes from a remote repository without automatically merging them into the current branch?<\/b><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">git update<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">git fetch<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">git download<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">git sync<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 2<\/b><\/p>\n<p><b>Explanation<\/b><\/p>\n<p><span style=\"font-weight: 400;\">git fetch<\/span><span style=\"font-weight: 400;\"> downloads new commits, branches, and other references from a remote repository without automatically merging those changes into the current working branch. This gives administrators and developers an opportunity to inspect incoming changes before integrating them. It is useful in controlled workflows where changes should be reviewed before merging. After fetching, commands such as <\/span><span style=\"font-weight: 400;\">git log<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">git diff<\/span><span style=\"font-weight: 400;\">, or a merge operation can be used to examine and integrate the new work.<\/span><\/p>\n<h3><b>Question 397<\/b><\/h3>\n<p><b>Which Ansible option allows an administrator to preview what changes a playbook would make without applying them?<\/b><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">&#8211;dry-run<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">&#8211;check<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">&#8211;preview<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">&#8211;test-only<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 2<\/b><\/p>\n<p><b>Explanation<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The Ansible <\/span><span style=\"font-weight: 400;\">&#8211;check<\/span><span style=\"font-weight: 400;\"> option runs a playbook in check mode so administrators can preview many potential changes without actually applying them. This is useful before making configuration changes across multiple systems. Check mode does not perfectly simulate every module or situation, so the output should still be reviewed carefully. It is especially helpful when combined with version-controlled playbooks and testing environments. Administrators should validate important changes before applying them to production systems.<\/span><\/p>\n<h3><b>Question 398<\/b><\/h3>\n<p><b>What is the main purpose of an Ansible handler?<\/b><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">To store encrypted passwords<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">To run an action when notified by a task<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">To create inventory files<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">To install Ansible itself<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 2<\/b><\/p>\n<p><b>Explanation<\/b><\/p>\n<p><span style=\"font-weight: 400;\">An Ansible handler performs an action when it is notified by another task, usually after a configuration change. A common example is restarting or reloading a service only when its configuration file has actually changed. This avoids unnecessary service restarts on every playbook run. Handlers support clean and efficient automation and work well with idempotent playbooks. Administrators should use handlers for actions that should happen as a result of specific changes rather than running them unconditionally.<\/span><\/p>\n<h3><b>Question 399<\/b><\/h3>\n<p><b>Which container file is commonly used to define instructions for building a Docker image?<\/b><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Containerfile<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Dockerfile<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Imagefile<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">DockerConfig<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 2<\/b><\/p>\n<p><b>Explanation<\/b><\/p>\n<p><span style=\"font-weight: 400;\">A <\/span><span style=\"font-weight: 400;\">Dockerfile<\/span><span style=\"font-weight: 400;\"> contains instructions used to build a Docker image. It can specify a base image, install packages, copy application files, define environment settings, expose ports, and specify the command used when a container starts. Keeping Dockerfiles simple and using trusted base images can improve security and maintainability. Administrators should avoid placing sensitive credentials directly inside Dockerfiles because image layers may preserve information even after files are removed in later steps.<\/span><\/p>\n<h3><b>Question 400<\/b><\/h3>\n<p><b>Which Kubernetes object is designed to store sensitive information such as passwords or API tokens?<\/b><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">ConfigMap<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Service<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Secret<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Deployment<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 3<\/b><\/p>\n<p><b>Explanation<\/b><\/p>\n<p><span style=\"font-weight: 400;\">A Kubernetes <\/span><span style=\"font-weight: 400;\">Secret<\/span><span style=\"font-weight: 400;\"> is designed to hold sensitive data such as passwords, tokens, and keys. A <\/span><span style=\"font-weight: 400;\">ConfigMap<\/span><span style=\"font-weight: 400;\"> is intended for non-sensitive configuration data. Although Kubernetes Secrets provide a dedicated mechanism for sensitive values, administrators should still use appropriate access controls and understand how secrets are stored and protected in their cluster. Applications can consume Secrets through environment variables or mounted files. Proper RBAC permissions are important so that only authorized workloads and users can access sensitive information.<\/span><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>View Full\u00a0CompTIA XK0-006 Exam Dumps\u00a0and Practice Test Dumps. &nbsp; Question 381 Which command can display the current status of a systemd-managed service? service-check systemctl status systemd-status statusctl Correct Answer: 2 Explanation The systemctl status command shows the current state of a systemd-managed service. It can display whether the service is active, inactive, failed, or running, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1648,1647],"tags":[],"_links":{"self":[{"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/posts\/11543"}],"collection":[{"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/comments?post=11543"}],"version-history":[{"count":1,"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/posts\/11543\/revisions"}],"predecessor-version":[{"id":11544,"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/posts\/11543\/revisions\/11544"}],"wp:attachment":[{"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/media?parent=11543"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/categories?post=11543"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/tags?post=11543"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}