Dumpscafe CompTIA-XK0-005

Page 1


Web: www.dumpscafe.com

Email: support@dumpscafe.com

IMPORTANT NOTICE

Feedback

We have developed quality product and state-of-art service to ensure our customers interest. If you have any suggestions, please feel free to contact us at feedback@dumpscafe.com

Support

If you have any questions about our product, please provide the following items: exam code screenshot of the question login id/email please contact us at and our technical experts will provide support within 24 hours. support@dumpscafe.com

Copyright

The product of each order has its own encryption code, so you should use it independently. Any unauthorized changes will inflict legal punishment. We reserve the right of final explanation for this statement.

Topic 2, Exam Pool B

Question #:1 - (Exam Topic 2)

Due to performance issues on a server, a Linux administrator needs to termi-nate an unresponsive process. Which of the following commands should the administrator use to terminate the process immediately without waiting for a graceful shutdown?

kill -SIGKILL 5545

kill -SIGTERM 5545

kill -SIGHUP 5545

kill -SIGINT 5545

Answer: A

Explanation

To terminate an unresponsive process immediately without waiting for a graceful shutdown, the administrator can use the command kill -SIGKILL 5545 (A). This will send a signal to the process with the PID 5545 that cannot be ignored or handled by the process, and force it to stop. The other commands will send different signals that may allow the process to perform some cleanup or termination actions, or may be ignored by the process. References:

[CompTIA Linux+ Study Guide], Chapter 6: Managing Processes, Section: Killing Processes

[How to Kill Processes in Linux]

Question #:2 - (Exam Topic 2)

A Linux administrator is installing a web server and needs to check whether web traffic has already been allowed through the firewall. Which of the following commands should the administrator use to accomplish this task?

firewalld query-service-http

firewall-cmd --check-service http

firewall-cmd --query-service http

firewalld --check-service http

Answer: C

Explanation

The command firewall-cmd --query-service http will accomplish the task of checking whether web traffic has already been allowed through the firewall. The firewall-cmd command is a tool for managing firewalld, which is a firewall service that provides dynamic and persistent network security on Linux systems. The firewalld uses zones and services to define the rules and policies for the network traffic. The zones are logical groups of network interfaces and sources that have the same level of trust and security. The services are predefined sets of ports and protocols that are associated with certain applications or functions. The --query-service http option queries whether a service is enabled in a zone. The http is the name of the service that the command should check. The http service represents the web traffic that uses the port 80 and the TCP protocol. The command firewall-cmd --query-service http will check whether the http service is enabled in the default zone, which is usually the public zone. The command will return yes if the web traffic has already been allowed through the firewall, or no if the web traffic has not been allowed through the firewall. This is the correct command to use to accomplish the task. The other options are incorrect because they either do not exist (firewalld query-service-http or firewalld --check-service http) or do not query the service (firewall-cmd --check-service http instead of firewall-cmd --query-service http). References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 12: Managing Network Connections, page 392.

Question #:3 - (Exam Topic 2)

A developer needs to launch an Nginx image container, name it Web001, and ex-pose port 8080 externally while mapping to port 80 inside the container. Which of the following commands will accomplish this task?

docker exec —it -p 8080: 80 ——name Web001 nginx

docker load -it -p 8080:80 ——name Web001 nginx

docker run -it -P 8080:80 ——name Web001 nginx

docker pull -it -p 8080:80 —name Web00l nginx

Answer: C

Explanation

To launch an Nginx image container, name it Web001, and expose port 8080 externally while mapping to port 80 inside the container, the administrator can use the command docker run -it -p 8080:80 --name Web001 nginx ©. This will create and start a new container from the Nginx image, assign it a name of Web001, and map port 8080 on the host to port 80 on the container. The other commands are not valid or do not meet the requirements. References:

[CompTIA Linux+ Study Guide], Chapter 11: Working with Containers, Section: Running Containers with Docker

[How to Run Docker Containers]

Question

#:4 - (Exam Topic 2)

Which of the following data structures is written in JSON?

Answer: C

Explanation

A. B.
C.
D.

Option C is the only data structure that is written in JSON format. JSON stands for JavaScript Object Notation, and it is a lightweight and human-readable data interchange format. JSON uses curly braces to enclose objects, which consist of key-value pairs separated by commas. JSON uses square brackets to enclose arrays, which consist of values separated by commas. JSON supports six data types: strings, numbers, booleans, null, objects, and arrays. Option C follows these rules and syntax of JSON, while the other options do not. Option A is written in XML format, which uses tags to enclose elements and attributes. Option B is written in YAML format, which uses indentation and colons to define key-value pairs. Option D is written in INI format, which uses sections and equal signs to define key-value pairs. References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 21: Automating Tasks with Ansible, page 591.

Topic 3, Exam Pool C

Question #:5 - (Exam Topic 3)

An organization's business office needs to collaborate on quarterly reports and asks the systems administrator to create a finance group. The administrator creates the following directory: drwxrwxr-x Business Business |j096 Oct 15 16:40 Q1

Which of the following commands will allow all members of the finance group to have group ownership of all files created in the Q1 directory while ensuring that members of the business group preserve access? (Select two).

chmod g+s Q1/

chmod u+s Q1/

chmod a+x Q1/ chown Finance Q1/

chmod g+x Q1/

Answer: A D

Explanation

To ensure all files created in Q1 inherit the group ownership of finance, the chmod g+s command sets the group ID (SGID) on the directory, ensuring new files belong to the group of the directory. chown Finance Q1/ changes the group ownership of Q1 to Finance, allowing Finance group members access. These settings facilitate collaborative permissions as per CompTIA Linux+ recommendations for group-based file sharing. Reference: CompTIA Linux+ Study Guide.

Question #:6 - (Exam Topic 3)

Users report that they are unable to reach the company website https://www.comptia.org. A systems administrator confirms the issue with the following command:

# curl https://www.comptia.org

curl: (7) Failed to connect to www.comptia.org port 443: No route to host

The administrator logs in to the company’s web server to check its configuration and sees the following output:

root@comptia.org:-># firewall-cmd --list-all

public (active)

target: default

icmp-block-inversion: no

interfaces: dummy0 eth0

sources:

services: cockpit dhcpv6-client http ssh

ports: 3001/tcp

protocols:

forward: no

masquerade: no

forward-ports:

source-ports:

icmp-blocks:

rich rules:

rule family="ipv4" source address="61.177.173.6" port port="ssh" protocol="tcp" reject type="icmp-portunreachable"

rule family="ipv4" source address="185.143.45.164" port port="ssh" protocol="tcp" reject type="icmp-portunreachable"

rule family="ipv4" source address="143.198.60.41" port port="ssh" protocol="tcp" reject type="icmp-portunreachable"

root@comptia.org:-># ip route default via 172.31.1.1 dev eth0 proto dhcp src 65.21.187.65 metric 100

10.0.6.0/24 dev dummy0 proto kernel scope link src 10.0.6.65 metric 550

172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1

172.18.0.0/16 dev br-28ac2eaeeca1 proto kernel scope link src 172.18.0.1

172.19.0.0/16 dev br-fb3897555ca3 proto kernel scope link src 172.19.0.1 linkdown

172.31.1.1 dev eth0 proto dhcp scope link src 65.21.187.65 metric 100

192.168.224.0/20 dev br-e949ab177d79 proto kernel scope link src 192.168.224.1 linkdown

192.168.240.0/20 dev br-6adf72ac0ae3 proto kernel scope link src 192.168.240.1 linkdown

Which of the following is causing the issue?

The web server's interface has no link.

The default route on the web server is incorrect.

HTTPS traffic is not allowed through the web server firewall.

User IP addresses are rejected by the firewall.

Answer: C

Explanation

The curl error "No route to host" suggests that the server is unreachable on port 443 (HTTPS).

The firewall-cmd --list-all output shows the active firewall rules:

The firewall is only allowing the following services:makefileCopyEditservices: cockpit dhcpv6client http ssh

The firewall is only allowing the following services:makefileCopyEditservices: cockpit dhcpv6client http ssh

The firewall is only allowing the following services:makefileCopyEditservices: cockpit dhcpv6client http ssh

The firewall is only allowing the following services:makefileCopyEditservices: cockpit dhcpv6client http ssh

Port 443 (HTTPS) is missing from the allowed services list.

Port 3001/tcp is open, but port 443 is not listed, which means HTTPS traffic is being blocked.

The routing table (ip route output) appears correct, as the default route is properly set to 172.31.1.1 via eth0. This rules out option B.

Option A is incorrect because eth0 is active and configured (default via 172.31.1.1 dev eth0), meaning the network interface is not down.

Option D is misleading because the firewall rules are only rejecting SSH traffic from specific IP addresses, not HTTPS traffic.

Fixing the Issue:

To allow HTTPS traffic, the administrator should enable HTTPS in the firewall:

# firewall-cmd --add-service=https --permanent

# firewall-cmd --reload

This will allow HTTPS (port 443) through the firewall.

References:

CompTIA Linux+ Official Documentation

firewalld Documentation - Red Hat

Linux Firewall Configuration - CompTIA Security+ Guide

Question #:7 - (Exam Topic 3)

An operations engineer is planning to start a container running a PostgreSQL database. The engineer wants the container to start automatically at system startup, mount the /home/db directory as /var/lib/postgresql inside the container, and expose port 5432 to the OS. Which of the following commands should the engineer run to achieve this task?

docker run -d --restart always -p 5432:5432 -v /home/db:/var/lib/postgresql postgresql:12

docker run -d --restart -p 5432:5432 --volume /var/lib/postgresql:/home/db postgresql:12

docker run -d --attach --platform 5432:5432 --volume /home/db:/var/lib/postgresql postgresql:12

docker run -d --init --restart --publish 5432:5432 --workdir /home/db:/var/lib/postgresql postgresql:12

Answer: A

Explanation

The command docker run -d --restart always -p 5432:5432 -v /home/db:/var/lib/postgresql postgresql:12 ensures that the PostgreSQL container is started in detached mode (-d), it restarts automatically on system startup (--restart always), mounts the host directory /home/db to /var/lib/postgresql, and exposes port 5432. This is a typical setup for running a database in a Docker container.

Question #:8 - (Exam Topic 3)

A Linux administrator encounters the following error in the Apache log files:

SQLSTATE[HY000] [2002] Permission denied

Which of the following commands should the administrator run to safely fix this issue?

A.

chcon -c httpd_sys_content_t /home/apache

B. C.

D. setsebool -F httpd_can_network_connect_db on setenforce 0

touch /.autorelabel

Answer: B

Explanation

The error indicates that SELinux is preventing Apache from connecting to the database. The command setsebool -F httpd_can_network_connect_db on allows the Apache web server to make network connections to the database, resolving the permission denied error without disabling SELinux entirely.

Topic 1, Exam pool A

Question #:9 - (Exam Topic 1)

A Linux administrator has installed a web server, a database server, and a web application on a server. The web application should be active in order to render the web pages. After the administrator restarts the server, the website displays the following message in the browser: Error establishing a database connection. The Linux administrator reviews the following relevant output from the systemd init files:

The administrator needs to ensure that the database is available before the web application is started. Which of the following should the administrator add to the HTTP server .service file to accomplish this task?

TRIGGERS=mariadb.service

ONFAILURE=mariadb.service

WANTEDBY=mariadb.service

REQUIRES=mariadb.service

Answer: D

Explanation

The administrator should add REQUIRES=mariadb.service to the HTTP server .service file to ensure that the database is available before the web application is started. This directive specifies that the HTTP server unit requires the MariaDB server unit to be started before it can run. If the MariaDB server unit fails to start or stops for any reason, the HTTP server unit will also fail or stop. This way, the dependency between the web application and the database is enforced by systemd.

The other options are not correct directives for accomplishing this task. TRIGGERS=mariadb.service is not a valid directive in systemd unit files. ONFAILURE=mariadb.service means that the HTTP server unit will start only if the MariaDB server unit fails, which is not what we want. WANTEDBY=mariadb.service means that the HTTP server unit will be started when the MariaDB server unit is enabled, but it does not imply a strong dependency or ordering relationship between them. References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 10: Managing Services with systemd; systemd.unit(5) - Linux manual page

Question #:10 - (Exam Topic 1)

A systems administrator is tasked with preventing logins from accounts other than root, while the file /etc /nologin exists. Which of the following PAM modules will accomplish this task?

A.

B. C. D.

pam_login.so

pam_access.so

pam_logindef.so

pam_nologin.so

Answer: D

Explanation

The PAM module pam_nologin.so will prevent logins from accounts other than root, while the file /etc /nologin exists. This module checks for the existence of the file /etc/nologin and displays its contents to the user before denying access. The root user is exempt from this check and can still log in. This is the correct module to accomplish the task. The other options are incorrect because they are either non-existent modules (pam_login.so or pam_logindef.so) or do not perform the required function (pam_access.so controls access based on host, user, or time). References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 15: Managing Users and Groups, page 471.

About dumpscafe.com

dumpscafe.com was founded in 2007. We provide latest & high quality IT / Business Certification Training Exam Questions, Study Guides, Practice Tests.

We help you pass any IT / Business Certification Exams with 100% Pass Guaranteed or Full Refund. Especially Cisco, CompTIA, Citrix, EMC, HP, Oracle, VMware, Juniper, Check Point, LPI, Nortel, EXIN and so on.

View list of all certification exams: All vendors

We prepare state-of-the art practice tests for certification exams. You can reach us at any of the email addresses listed below.

Sales: sales@dumpscafe.com

Feedback: feedback@dumpscafe.com

Support: support@dumpscafe.com

Any problems about IT certification or our products, You can write us back and we will get back to you within 24 hours.

Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.