CompTIA XK0-005 Practice Test - Questions Answers, Page 31
List of questions
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?
snap list
snap find
snap install
snap try
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).
docker build -t Test-Container
docker tag Test-Container
docker inspect Test-Container
docker run -p 5000:80 Test-Container
docker push Test-Container
docker run -p 80:9000 Test-Container
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?
After=docker-repository.mount
ExecStart=/usr/bin/mount -a
Requires=docker-repository.mount
RequiresMountsFor=docker-repository.mount
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?
Members of the wheel group can read files in /comptia.
Newly created files in /comptia will have the sticky bit set.
Other users can create files in /comptia.
Only root can create files in /comptia.
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?
/etc/resolv.conf
/etc/hosts
/etc/sysconfig/network-scripts
/etc/nsswitch.conf
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?
systemctl reload httpd
systemctl restart httpd
systemctl status httpd
systemctl mask httpd
Which of the following is a benefit of a service mesh?
Encrypted communication between two services in a Kubernetes environment
Direct access to the Kubernetes API services through the use of tokens
Elevated privileges in a Kubernetes pod to allow root access in a hardened cluster
Creating PVCs in a Kubernetes cluster to store and manage persistent data
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?
The system has consumed the system memory and swap space
The system has enough free memory space
The system has swap disabled
The system has allocated enough buffer space
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?
systemctl restart networkd
systemctl enable networkd
systemctl status networkd
systemctl isolate networkd
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?
The password for userA is not set
The group for userA is not assigned correctly
The account password for userA has expired
The assigned home directory is not owned by userA
Question