ExamGecko
Home Home / CompTIA / XK0-005

CompTIA XK0-005 Practice Test - Questions Answers, Page 5

Question list
Search
Search

List of questions

Search

Related questions











A Linux administrator is tasked with creating resources using containerization. When deciding how to create this type of deployment, the administrator identifies some key features, including portability, high availability, and scalability in production. Which of the following should the Linux administrator choose for the new design?

A.
Docker
A.
Docker
Answers
B.
On-premises systems
B.
On-premises systems
Answers
C.
Cloud-based systems
C.
Cloud-based systems
Answers
D.
Kubernetes
D.
Kubernetes
Answers
Suggested answer: D

Explanation:

The Linux administrator should choose Kubernetes for the new design that requires portability, high availability, and scalability in production using containerization. Kubernetes is an open-source platform that automates the deployment, scaling, and management of containerized applications across clusters of nodes. Kubernetes provides features such as service discovery, load balancing, storage orchestration, self-healing, secret and configuration management, and batch execution. Kubernetes also supports multiple container runtimes, such as Docker, containerd, and CRI-O, making it portable across different platforms and clouds. Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 18: Automating Tasks; What is Kubernetes? | Kubernetes

Which of the following tools is commonly used for creating CI/CD pipelines?

A.
Chef
A.
Chef
Answers
B.
Puppet
B.
Puppet
Answers
C.
Jenkins
C.
Jenkins
Answers
D.
Ansible
D.
Ansible
Answers
Suggested answer: C

Explanation:

The tool that is commonly used for creating CI/CD pipelines is Jenkins. Jenkins is an open-source automation server that enables continuous integration and continuous delivery (CI/CD) of software projects. Jenkins allows developers to build, test, and deploy code changes automatically and frequently using various plugins and integrations. Jenkins also supports distributed builds, parallel execution, pipelines as code, and real-time feedback. Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 19: Managing Source Code; Jenkins

A systems administrator requires that all files that are created by the user named web have read-only permissions by the owner. Which of the following commands will satisfy this requirement?

A.
chown web:web /home/web
A.
chown web:web /home/web
Answers
B.
chmod -R 400 /home/web
B.
chmod -R 400 /home/web
Answers
C.
echo "umask 377" >> /home/web/.bashrc
C.
echo "umask 377" >> /home/web/.bashrc
Answers
D.
setfacl read /home/web
D.
setfacl read /home/web
Answers
Suggested answer: C

Explanation:

The command that will satisfy the requirement of having all files that are created by the user named web have read-only permissions by the owner is echo "umask 377" >> /home/web/.bashrc. This command will append the umask 377 command to the end of the .bashrc file in the web user's home directory. The .bashrc file is a shell script that is executed whenever a new interactive shell session is started by the user. The umask command sets the file mode creation mask, which determines the default permissions for newly created files or directories by subtracting from the maximum permissions (666 for files and 777 for directories). The umask 377 command means that the user does not want to give any permissions to the group or others (3 = 000 in binary), and only wants to give read permission to the owner (7 - 3 = 4 = 100 in binary). Therefore, any new file created by the web user will have read-only permission by the owner (400) and no permission for anyone else. Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 8: Managing Users and Groups; Umask Command in Linux | Linuxize

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.
pam_login.so
A.
pam_login.so
Answers
B.
pam_access.so
B.
pam_access.so
Answers
C.
pam_logindef.so
C.
pam_logindef.so
Answers
D.
pam_nologin.so
D.
pam_nologin.so
Answers
Suggested 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). Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 15: Managing Users and Groups, page 471.

A systems administrator has been tasked with disabling the nginx service from the environment to prevent it from being automatically and manually started. Which of the following commands will accomplish this task?

A.
systemctl cancel nginx
A.
systemctl cancel nginx
Answers
B.
systemctl disable nginx
B.
systemctl disable nginx
Answers
C.
systemctl mask nginx
C.
systemctl mask nginx
Answers
D.
systemctl stop nginx
D.
systemctl stop nginx
Answers
Suggested answer: C

Explanation:

The command systemctl mask nginx disables the nginx service from the environment and prevents it from being automatically and manually started. This command creates a symbolic link from the service unit file to /dev/null, which makes the service impossible to start. This is the correct way to accomplish the task. The other options are incorrect because they either do not exist (systemctl cancel nginx), do not prevent manual start (systemctl disable nginx), or do not prevent automatic start (systemctl stop nginx). Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 14: Managing Processes and Scheduling Tasks, page 429.

A Linux administrator is troubleshooting an issue in which an application service failed to start on a Linux server. The administrator runs a few commands and gets the following outputs:

Based on the above outputs, which of the following is the MOST likely action the administrator should take to resolve this issue?

A.
Enable the logsearch.service and restart the service.
A.
Enable the logsearch.service and restart the service.
Answers
B.
Increase the TimeoutStartUSec configuration for the logsearch.sevice.
B.
Increase the TimeoutStartUSec configuration for the logsearch.sevice.
Answers
C.
Update the OnCalendar configuration to schedule the start of the logsearch.service.
C.
Update the OnCalendar configuration to schedule the start of the logsearch.service.
Answers
D.
Update the KillSignal configuration for the logsearch.service to use TERM.
D.
Update the KillSignal configuration for the logsearch.service to use TERM.
Answers
Suggested answer: B

Explanation:

The administrator should increase the TimeoutStartUSec configuration for the logsearch.service to resolve the issue. The output of systemctl status logsearch.service shows that the service failed to start due to a timeout. The output of cat /etc/systemd/system/logsearch.service shows that the service has a TimeoutStartUSec configuration of 10 seconds, which might be too short for the service to start. The administrator should increase this value to a higher number, such as 30 seconds or 1 minute, and then restart the service. The other options are incorrect because they are not related to the issue. The service is already enabled, as shown by the output of systemctl is-enabled logsearch.service. The service does not use an OnCalendar configuration, as it is not a timer unit. The service does not use a KillSignal configuration, as it is not being killed by a signal. Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 14: Managing Processes and Scheduling Tasks, pages 434-435.

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?

A.
TRIGGERS=mariadb.service
A.
TRIGGERS=mariadb.service
Answers
B.
ONFAILURE=mariadb.service
B.
ONFAILURE=mariadb.service
Answers
C.
WANTEDBY=mariadb.service
C.
WANTEDBY=mariadb.service
Answers
D.
REQUIRES=mariadb.service
D.
REQUIRES=mariadb.service
Answers
Suggested 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. Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 10: Managing Services with systemd; systemd.unit(5) - Linux manual page

Several users reported that they were unable to write data to the /oracle1 directory. The following output has been provided:

Which of the following commands should the administrator use to diagnose the issue?

A.
df -i /oracle1
A.
df -i /oracle1
Answers
B.
fdisk -1 /dev/sdb1
B.
fdisk -1 /dev/sdb1
Answers
C.
lsblk /dev/sdb1
C.
lsblk /dev/sdb1
Answers
D.
du -sh /oracle1
D.
du -sh /oracle1
Answers
Suggested answer: A

Explanation:

The administrator should use the command df -i /oracle1 to diagnose the issue of users being unable to write data to the /oracle1 directory. This command will show the inode usage of the /oracle1 filesystem, which indicates how many files and directories can be created on it. If the inode usage is 100%, it means that no more files or directories can be added, even if there is still free space on the disk. The administrator can then delete some unnecessary files or directories, or increase the inode limit of the filesystem, to resolve the issue.

The other options are not correct commands for diagnosing this issue. The fdisk -l /dev/sdb1 command will show the partition table of /dev/sdb1, which is not relevant to the inode usage. The lsblk /dev/sdb1 command will show information about /dev/sdb1 as a block device, such as its size, mount point, and type, but not its inode usage. The du -sh /oracle1 command will show the disk usage of /oracle1 in human-readable format, but not its inode usage. Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 7: Managing Disk Storage; How to Check Inode Usage in Linux - Fedingo

After installing some RPM packages, a systems administrator discovers the last package that was installed was not needed. Which of the following commands can be used to remove the package?

A.
dnf remove packagename
A.
dnf remove packagename
Answers
B.
apt-get remove packagename
B.
apt-get remove packagename
Answers
C.
rpm -i packagename
C.
rpm -i packagename
Answers
D.
apt remove packagename
D.
apt remove packagename
Answers
Suggested answer: A

Explanation:

The command that can be used to remove an RPM package that was installed by mistake is dnf remove packagename. This command will use the DNF package manager to uninstall an RPM package and its dependencies from a Linux system that uses RPM-based distributions, such as Red Hat Enterprise Linux or CentOS. The DNF package manager handles dependency resolution and metadata searching for RPM packages.

The other options are not correct commands for removing an RPM package from a Linux system. The apt-get remove packagename and apt remove packagename commands are used to remove Debian packages from a Linux system that uses Debian-based distributions, such as Ubuntu or Debian. They are not compatible with RPM packages. The rpm -i packagename command is used to install an RPM package, not to remove it. Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 9: Managing Software Packages; How to install/remove/query/update RPM packages in Linux (Cheat Sheet …

A systems administrator is checking the system logs. The administrator wants to look at the last 20 lines of a log. Which of the following will execute the command?

A.
tail -v 20
A.
tail -v 20
Answers
B.
tail -n 20
B.
tail -n 20
Answers
C.
tail -c 20
C.
tail -c 20
Answers
D.
tail -l 20
D.
tail -l 20
Answers
Suggested answer: B

Explanation:

The command tail -n 20 will display the last 20 lines of a file. The -n option specifies the number of lines to show. This is the correct command to execute the task. The other options are incorrect because they either use the wrong options (-v, -c, or -l) or have the wrong arguments (20 instead of 20 filename). Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 11:

Managing Files and Directories, page 352.

Total 371 questions
Go to page: of 38