ExamGecko
Home Home / CompTIA / XK0-005

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

Question list
Search
Search

List of questions

Search

Related questions











An administrator thinks that a package was installed using a snap. Which of the following commands can the administrator use to verify this information?

A.

snap list

A.

snap list

Answers
B.

snap find

B.

snap find

Answers
C.

snap install

C.

snap install

Answers
D.

snap try

D.

snap try

Answers
Suggested answer: A

Explanation:

Again, the correct command to list all installed snap packages is snap list. This command provides information about installed snap applications and their versions, helping the administrator verify the package installation.

A Linux administrator needs to expose port 9000 for a container to listen during runtime. The Linux administrator creates a Dockerfile with the following entries:

sql

FROM node:9-alpine

WORKDIR /usr/src/app

COPY package.json ./

RUN npm install

COPY . .

EXPOSE 9000

CMD ['npm', 'start']

Which of the following commands should the administrator use to accomplish this task? (Select two).

A.

docker build -t Test-Container

A.

docker build -t Test-Container

Answers
B.

docker tag Test-Container

B.

docker tag Test-Container

Answers
C.

docker inspect Test-Container

C.

docker inspect Test-Container

Answers
D.

docker run -p 5000:80 Test-Container

D.

docker run -p 5000:80 Test-Container

Answers
E.

docker push Test-Container

E.

docker push Test-Container

Answers
F.

docker run -p 80:9000 Test-Container

F.

docker run -p 80:9000 Test-Container

Answers
Suggested answer: A, F

Explanation:

First, the administrator should build the container image using the command docker build -t Test-Container, which creates a Docker image with the specified configuration. To run the container and expose port 9000, the correct command is docker run -p 80:9000 Test-Container, which maps the container's port 9000 to port 80 on the host machine, making the service accessible externally on port 80.

A Linux administrator has defined a systemd script docker-repository.mount to mount a volume for use by the Docker service. The administrator wants to ensure that the Docker service does not start until the volume is mounted. Which of the following configurations needs to be added to the Docker service definition to best accomplish this task?

A.

After=docker-repository.mount

A.

After=docker-repository.mount

Answers
B.

ExecStart=/usr/bin/mount -a

B.

ExecStart=/usr/bin/mount -a

Answers
C.

Requires=docker-repository.mount

C.

Requires=docker-repository.mount

Answers
D.

RequiresMountsFor=docker-repository.mount

D.

RequiresMountsFor=docker-repository.mount

Answers
Suggested answer: C

Explanation:

The Requires=docker-repository.mount directive in the Docker service file ensures that the Docker service depends on the docker-repository.mount unit. If the mount is not available, Docker will not start. This guarantees that the necessary volume is mounted before the Docker service attempts to use it.

A systems administrator created a new directory with specific permissions. Given the following output:

arduino

$ ls -ld /comptia

drwxr-x--- 2 root root 4096 Oct 20 20:13 /comptia

$ getfacl /comptia

# file: /comptia

# owner: root

# group: root

user::rwx

group::r-x

other::---

default:user::rwx

default:group::r-x

default:group:wheel:rwx

default:mask::rwx

default:other::---

Which of the following permissions are enforced on /comptia?

A.

Members of the wheel group can read files in /comptia.

A.

Members of the wheel group can read files in /comptia.

Answers
B.

Newly created files in /comptia will have the sticky bit set.

B.

Newly created files in /comptia will have the sticky bit set.

Answers
C.

Other users can create files in /comptia.

C.

Other users can create files in /comptia.

Answers
D.

Only root can create files in /comptia.

D.

Only root can create files in /comptia.

Answers
Suggested answer: A

Explanation:

According to the getfacl output, the default ACL for the group wheel is set to rwx, meaning members of the wheel group have read, write, and execute permissions. Therefore, they can access and manage files in the /comptia directory. Other users (other::---) have no permissions on this directory.

A network administrator issues the dig www.foo.com command and receives an NXDOMAIN response. Which of the following files should the administrator check first?

A.

/etc/resolv.conf

A.

/etc/resolv.conf

Answers
B.

/etc/hosts

B.

/etc/hosts

Answers
C.

/etc/sysconfig/network-scripts

C.

/etc/sysconfig/network-scripts

Answers
D.

/etc/nsswitch.conf

D.

/etc/nsswitch.conf

Answers
Suggested answer: A

Explanation:

The NXDOMAIN response indicates that the domain name could not be resolved. The administrator should first check /etc/resolv.conf, which contains the DNS server configuration. If the DNS servers listed are incorrect or unreachable, domain resolution will fail.

A Linux administrator updated the configuration file for the httpd web service. The administrator needs to apply the updated changes to the service without interrupting any running sessions. Which of the following commands should the administrator run to accomplish this task?

A.

systemctl reload httpd

A.

systemctl reload httpd

Answers
B.

systemctl restart httpd

B.

systemctl restart httpd

Answers
C.

systemctl status httpd

C.

systemctl status httpd

Answers
D.

systemctl mask httpd

D.

systemctl mask httpd

Answers
Suggested answer: A

Explanation:

The systemctl reload httpd command reloads the Apache HTTP server configuration without terminating any existing connections. This is ideal for applying configuration changes without disrupting the current web traffic, ensuring seamless operation.

Which of the following is a benefit of a service mesh?

A.

Encrypted communication between two services in a Kubernetes environment

A.

Encrypted communication between two services in a Kubernetes environment

Answers
B.

Direct access to the Kubernetes API services through the use of tokens

B.

Direct access to the Kubernetes API services through the use of tokens

Answers
C.

Elevated privileges in a Kubernetes pod to allow root access in a hardened cluster

C.

Elevated privileges in a Kubernetes pod to allow root access in a hardened cluster

Answers
D.

Creating PVCs in a Kubernetes cluster to store and manage persistent data

D.

Creating PVCs in a Kubernetes cluster to store and manage persistent data

Answers
Suggested answer: A

Explanation:

A service mesh provides secure, encrypted communication between microservices in a Kubernetes environment. It also provides features like traffic management, observability, and load balancing at the network layer. The most popular service mesh implementations, such as Istio, handle security by enforcing mutual TLS (mTLS) encryption between services, ensuring data privacy and integrity.

While troubleshooting server issues, a Linux systems administrator obtains the following output:

yaml

total used free shared buff/cache available

Mem: 3736 3538 33 2 48 25

Swap: 2047 1824 223

Which of the following best describes the state of the system?

A.

The system has consumed the system memory and swap space

A.

The system has consumed the system memory and swap space

Answers
B.

The system has enough free memory space

B.

The system has enough free memory space

Answers
C.

The system has swap disabled

C.

The system has swap disabled

Answers
D.

The system has allocated enough buffer space

D.

The system has allocated enough buffer space

Answers
Suggested answer: A

Explanation:

The output shows that the system is running low on available memory and has heavily utilized swap space (1824 MB out of 2047 MB). This indicates that both RAM and swap are being exhausted, which can lead to performance degradation. The system is likely experiencing memory pressure and may require additional RAM or optimizations to reduce memory consumption.

An administrator made a change to a system's network configuration. Which of the following best represents what the administrator should do to have the new configuration take effect?

A.

systemctl restart networkd

A.

systemctl restart networkd

Answers
B.

systemctl enable networkd

B.

systemctl enable networkd

Answers
C.

systemctl status networkd

C.

systemctl status networkd

Answers
D.

systemctl isolate networkd

D.

systemctl isolate networkd

Answers
Suggested answer: A

Explanation:

The command systemctl restart networkd is used to apply new network configurations by restarting the network service. This ensures that any changes made to network settings (such as IP addresses, routes, or DNS settings) take effect without requiring a system reboot.

A user (userA) has reported issues while logging in to the system. The following output has been provided:

bash

Could not chdir to home directory /home/userA: Permission denied

-bash: /home/userA/.bash_profile: Permission denied

# cat /etc/passwd | grep userA

userA:x:1234:3400:userA account:/home/userA/:/bin/bash

# passwd -S userA

userA PS 2022-10-17 1 99999 0 (Password set. SHA512 crypt.)

# groups userA

admin dev usergrp

# ls -lth /home/

drwx------ 7 root admin 9 Jan 17 2019 userA

drwxr-xr-x 4 userC app 9 Jan 23 2020 userC

Which of the following describes the issue userA is having?

A.

The password for userA is not set

A.

The password for userA is not set

Answers
B.

The group for userA is not assigned correctly

B.

The group for userA is not assigned correctly

Answers
C.

The account password for userA has expired

C.

The account password for userA has expired

Answers
D.

The assigned home directory is not owned by userA

D.

The assigned home directory is not owned by userA

Answers
Suggested answer: D

Explanation:

The issue occurs because the home directory /home/userA is owned by root, not by userA, as seen from the ls -lth /home output. In Linux, the user must have ownership of their home directory to log in and access their files properly. To fix this, the administrator must change ownership using chown userA:userA /home/userA.

Total 371 questions
Go to page: of 38