ExamGecko
Home Home / CompTIA / XK0-005

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

Question list
Search
Search

List of questions

Search

Related questions











A Linux administrator is implementing a CI/CD process for the company's internal accounting web application. Which of the following best defines the purpose of this process?

A.

To automate the process of building, testing, and deploying application components

A.

To automate the process of building, testing, and deploying application components

Answers
B.

To perform security penetration tests on deployed applications to identify vulnerabilities

B.

To perform security penetration tests on deployed applications to identify vulnerabilities

Answers
C.

To formalize the approval process of application releases and configuration changes

C.

To formalize the approval process of application releases and configuration changes

Answers
D.

To leverage code to document the infrastructure, configurations, and dependencies

D.

To leverage code to document the infrastructure, configurations, and dependencies

Answers
Suggested answer: A

Explanation:

CI/CD (Continuous Integration/Continuous Deployment) is a practice that automates the process of building, testing, and deploying applications. This approach reduces manual intervention, ensuring code changes are integrated and tested frequently, leading to faster and more reliable application deployment.

A systems administrator is customizing a new Linux server. Which of the following settings for umask would ensure that new files have the default permissions of -rw-r--r--?

A.

0017

A.

0017

Answers
B.

0027

B.

0027

Answers
C.

0038

C.

0038

Answers
D.

0640

D.

0640

Answers
Suggested answer: B

Explanation:

The umask determines the default permission for new files. To get -rw-r--r-- (644), the umask should be set to 0027. This sets the permissions to allow read and write for the owner, read-only for the group, and no permissions for others.

An administrator accidentally installed the httpd RPM package along with several dependencies. Which of the following options is the best way for the administrator to revert the package installation?

A.

dnf clean all

A.

dnf clean all

Answers
B.

rpm -e httpd

B.

rpm -e httpd

Answers
C.

apt-get clean

C.

apt-get clean

Answers
D.

yum history undo last

D.

yum history undo last

Answers
Suggested answer: D

Explanation:

The yum history undo last command allows the administrator to undo the most recent transaction, effectively removing the httpd package and any installed dependencies. This is the safest and easiest way to revert package installations in RPM-based systems using yum.

A Linux administrator is configuring a log collector agent to monitor logs in /var/log/collector. The agent is reporting that it cannot write to the directory. The agent runs as the logger user account. The administrator runs a few commands and reviews the following output:

makefile

Output 1:

drwxr-xr-x. 1 root root 0 Oct 20:13 collector

Output 2:

file: /var/log/collector

owner: root

group: root

user::rwx

group::r-x

mask::rwx

other::r-x

Output 3:

uid=1010(logger) gid=1010(monitor) groups=1010(monitor)

Which of the following is the best way to resolve the issue?

A.

setfacl -Rm u:logger /var/log/collector

A.

setfacl -Rm u:logger /var/log/collector

Answers
B.

usermod -aG root logger

B.

usermod -aG root logger

Answers
C.

chmod 644 /var/log/collector

C.

chmod 644 /var/log/collector

Answers
D.

chown -R logger /var/log

D.

chown -R logger /var/log

Answers
Suggested answer: A

Explanation:

The issue is that the logger user does not have write permissions to /var/log/collector. Using setfacl (Access Control Lists) allows fine-grained control over file permissions, granting the logger user the necessary read-write access to the directory without changing the owner or group.

An administrator is running a web server in a container named WEB, but none of the error output is showing. Which of the following should the administrator use to generate the errors on the container?

A.

docker-compose inspect WEB

A.

docker-compose inspect WEB

Answers
B.

docker logs WEB

B.

docker logs WEB

Answers
C.

docker run --name WEB --volume /dev/stdout:/var/log/nginx/error.log

C.

docker run --name WEB --volume /dev/stdout:/var/log/nginx/error.log

Answers
D.

docker ps WEB -f

D.

docker ps WEB -f

Answers
Suggested answer: B

Explanation:

The docker logs command retrieves logs, including errors, for a running container. By using docker logs WEB, the administrator can check the error output generated by the web server container and debug any issues related to application performance or errors.

A Linux systems administrator is working to obtain the installed kernel version of several hundred systems. Which of the following utilities should the administrator use for this task?

A.

Ansible

A.

Ansible

Answers
B.

Git

B.

Git

Answers
C.

Docker

C.

Docker

Answers
D.

Bash

D.

Bash

Answers
Suggested answer: A

Explanation:

Ansible is an open-source automation tool that can manage multiple systems simultaneously. Using an Ansible playbook, the administrator can run commands across several servers to obtain the installed kernel version efficiently. A simple ansible all -m command -a 'uname -r' will retrieve the kernel version from all target systems.

A systems administrator identifies multiple processes in a zombie state. Which of the following signals would be best for the administrator to send to the PPID?

A.

SIGTERM

A.

SIGTERM

Answers
B.

SIGHUP

B.

SIGHUP

Answers
C.

SIGQUIT

C.

SIGQUIT

Answers
D.

SIGSTOP

D.

SIGSTOP

Answers
Suggested answer: A

Explanation:

A zombie process is a process that has completed execution but still has an entry in the process table because its parent process has not read its exit status. The best signal to send to the parent process is SIGTERM, which politely asks it to terminate and release the resources held by the zombie child processes.

A Linux administrator needs to check extended permissions applied to the directory test. Which of the following commands should the administrator use to help with this task?

A.

getsebool test/

A.

getsebool test/

Answers
B.

getenforce test/

B.

getenforce test/

Answers
C.

getfacl test/

C.

getfacl test/

Answers
D.

ls -al test/

D.

ls -al test/

Answers
Suggested answer: C

Explanation:

getfacl is the command used to view the Access Control List (ACL) of a file or directory, which shows extended permissions beyond the basic owner, group, and others. This is essential for checking permissions that are set using ACLs on the directory test.

A DevOps engineer is working on a local copy of a Git repository. The engineer would like to switch from the main branch to the staging branch but notices the staging branch does not exist. Which of the following Git commands should the engineer use to perform this task?

A.

git branch -m staging

A.

git branch -m staging

Answers
B.

git commit -m staging

B.

git commit -m staging

Answers
C.

git status -b staging

C.

git status -b staging

Answers
D.

git checkout -b staging

D.

git checkout -b staging

Answers
Suggested answer: D

Explanation:

The git checkout -b staging command creates a new branch called staging and switches to it. This is useful when you want to create a new branch locally and begin working on it. The -b flag is used to create the branch if it doesn't exist.

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?

A.

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

A.

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

Answers
B.

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

B.

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

Answers
C.

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

C.

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

Answers
D.

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

D.

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

Answers
Suggested 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.

Total 371 questions
Go to page: of 38