ExamGecko
Home Home / CompTIA / XK0-005

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

Question list
Search
Search

List of questions

Search

Related questions











Which of the following options describes the purpose of YAML?

A.

YAML is a binary format used to ensure data transfer in a non-human-readable format

A.

YAML is a binary format used to ensure data transfer in a non-human-readable format

Answers
B.

YAML is used for configuration files and data serialization in IaC tools in a human-readable format

B.

YAML is used for configuration files and data serialization in IaC tools in a human-readable format

Answers
C.

YAML is like HTML and is used to create web page structure content for web deployment

C.

YAML is like HTML and is used to create web page structure content for web deployment

Answers
D.

YAML is designed for web development and has libraries for infrastructure automation

D.

YAML is designed for web development and has libraries for infrastructure automation

Answers
Suggested answer: B

Explanation:

YAML (YAML Ain't Markup Language) is a human-readable data serialization format often used for configuration files and in Infrastructure as Code (IaC) tools such as Ansible and Kubernetes. YAML files are easy to read and write, making them ideal for specifying infrastructure configurations and managing declarative environments.

Users are reporting that a production application has slow performance. A systems administrator logs in to the server and performs some basic checks. Given the following:

yaml

[root@comptia]# ps -o pcpu; pidstat 1

Average: UID PID %usr %system %wait %CPU Command

Average: 0 937242 32.39 0 63.21 32.39 app_prd

Average: 0 937245 44.97 0.31 51.57 45.28 app_prd

Average: 0 937244 23.62 0 63.55 28.62 app_prd

[root@comptia]# vmstat 1

procs memory swap io system cpu

r b swpd free buff cache si so bi bo in cs us sy id wa st

16 0 978912 376320 50804 10296312 0 0 0 44 5503 2962 98 2 0 0 0

[root@comptia]# free -m

total used free shared buff/cache available

Mem: 15533 5063 365 164 10104 9975

Swap: 7931 955 6976

Which of the following is causing the performance issue?

A.

The server does not have enough memory

A.

The server does not have enough memory

Answers
B.

Too many processes are running on the server

B.

Too many processes are running on the server

Answers
C.

The server CPU is receiving too much load

C.

The server CPU is receiving too much load

Answers
D.

The server is swapping

D.

The server is swapping

Answers
Suggested answer: D

Explanation:

The output from free -m shows that a significant portion of the swap space (955 MB) is being used, indicating the server is swapping. Swapping occurs when the system runs low on physical memory, leading to poor performance because the system must offload memory pages to the slower swap space. To resolve this, either more physical memory should be added or the application's memory usage should be optimized.

The development team created a new branch with code changes that a Linux administrator needs to pull from the remote repository. When the administrator looks for the branch in Git, the branch in question is not visible. Which of the following commands should the Linux administrator run to refresh the branch information?

A.

git fetch

A.

git fetch

Answers
B.

git checkout

B.

git checkout

Answers
C.

git clone

C.

git clone

Answers
D.

git branch

D.

git branch

Answers
Suggested answer: A

Explanation:

git fetch is the command used to refresh the list of branches from the remote repository. It retrieves any new branches and updates the local metadata about the remote repository, making the branch visible locally. It does not change the working directory or merge any changes but updates the references.

After connecting to a remote host via SSH, an administrator attempts to run an application but receives the following error:

arduino

Error: cannot open display:

Which of the following should the administrator do to resolve this error?

A.

Disconnect from the SSH session and reconnect using the ssh -X command

A.

Disconnect from the SSH session and reconnect using the ssh -X command

Answers
B.

Add Options X11 to the /home/admin/.ssh/authorized_keys file

B.

Add Options X11 to the /home/admin/.ssh/authorized_keys file

Answers
C.

Open port 6000 on the workstation and restart the firewalld service

C.

Open port 6000 on the workstation and restart the firewalld service

Answers
D.

Enable X11 forwarding in /etc/ssh/ssh_config and restart the server

D.

Enable X11 forwarding in /etc/ssh/ssh_config and restart the server

Answers
Suggested answer: D

Explanation:

The error indicates that X11 forwarding is not enabled. X11 forwarding allows graphical applications to be displayed on a remote system over an SSH connection. Enabling X11 forwarding in /etc/ssh/ssh_config and restarting the SSH service ensures that the necessary configuration is applied, allowing the administrator to open graphical applications remotely.

A systems administrator needs to know the mail exchange (MX) record for the foo.com domain. Which of the following commands will accomplish this task?

A.

telnet mx foo.com

A.

telnet mx foo.com

Answers
B.

dig mx foo.com

B.

dig mx foo.com

Answers
C.

nslookup mx foo.com

C.

nslookup mx foo.com

Answers
D.

host mx foo.com

D.

host mx foo.com

Answers
Suggested answer: B

Explanation:

The dig command is used for querying DNS information. To retrieve the MX records for a domain (which indicate where emails should be routed), the command dig mx foo.com is used. This returns the mail servers associated with the domain, including their priority levels.

Which of the following commands should a technician use to create an administrative account for the username Joe?

A.

sudo useradd -G wheel joe

A.

sudo useradd -G wheel joe

Answers
B.

sudo useradd joe; sudo passwd -l joe

B.

sudo useradd joe; sudo passwd -l joe

Answers
C.

sudo useradd joe; sudo cat key.pem > ~/.ssh/authorized_keys

C.

sudo useradd joe; sudo cat key.pem > ~/.ssh/authorized_keys

Answers
D.

sudo useradd joe; groupadd admin joe

D.

sudo useradd joe; groupadd admin joe

Answers
Suggested answer: A

Explanation:

The -G wheel option adds the user joe to the wheel group, which is a special group that allows users to execute administrative commands using sudo. This is the correct way to create a user with administrative privileges in many Linux distributions, including Red Hat-based ones.

A Linux administrator needs to forward port 8000 on a remote server to port 8000 on a local server. Which of the following commands should the administrator run on the local server to achieve this goal?

A.

firewall-cmd --add-forward-port=port=8000 =tcp =8000 =remote

A.

firewall-cmd --add-forward-port=port=8000 =tcp =8000 =remote

Answers
B.

iptables -A FORWARD -m state -p tcp -d remote --dport 9000 -j accept

B.

iptables -A FORWARD -m state -p tcp -d remote --dport 9000 -j accept

Answers
C.

ssh -R 8000:localhost:9000 remote

C.

ssh -R 8000:localhost:9000 remote

Answers
D.

socat TCP4-LISTEN:8000,fork TCP4:remote:8000

D.

socat TCP4-LISTEN:8000,fork TCP4:remote:8000

Answers
Suggested answer: C

Explanation:

The ssh -R command sets up reverse port forwarding, which allows connections from the remote server to be forwarded to the local machine. In this case, ssh -R 8000:localhost:9000 remote will forward traffic on port 8000 on the remote server to port 9000 on the local machine.

A systems administrator created a user cron to run a scheduled database backup cronjob on the server at 1 a.m. every day. The following is the cronjob syntax:

0 1 * * * /bin/sh backup.sh

The backups, however, are not being created. When checking the crontab file, the administrator sees the following error:

/var/spool/cron/crontab/cron: Permission denied

Which of the following will permit the cronjob to execute?

A.

Creating the file cron.allow and adding user cron to it

A.

Creating the file cron.allow and adding user cron to it

Answers
B.

Giving cron ownership of the file /usr/bin/crontab

B.

Giving cron ownership of the file /usr/bin/crontab

Answers
C.

Running sudo cron restart to activate the cronjob

C.

Running sudo cron restart to activate the cronjob

Answers
D.

Running sudo crontab -u cron -e to edit the file with sudo

D.

Running sudo crontab -u cron -e to edit the file with sudo

Answers
Suggested answer: A

Explanation:

The error indicates that the cron user does not have permission to run the cronjob. Creating a cron.allow file and adding the user cron to it will allow that user to run cronjobs. The cron.allow file is a security feature that controls which users are allowed to use cron.

A Linux administrator deployed a large-scale application service as a containerized pod. The Linux administrator needs to continually send the application's log file to the company's central log store. Which of the following should the Linux administrator do to efficiently perform this task?

A.

Configure a sidecar to perform log shipping

A.

Configure a sidecar to perform log shipping

Answers
B.

Run docker exec to access the logs within the container

B.

Run docker exec to access the logs within the container

Answers
C.

Execute docker inspect and run a log rsync replication

C.

Execute docker inspect and run a log rsync replication

Answers
D.

Set up a custom task scheduler via kubectl

D.

Set up a custom task scheduler via kubectl

Answers
Suggested answer: A

Explanation:

In Kubernetes, a sidecar container can be added to the same pod as the main application. The sidecar handles tasks like log shipping, monitoring, or updating without interrupting the primary application. This is an efficient and widely-used pattern for managing application logs in containerized environments.

A Linux administrator needs to run a web application on a server that requires the use of a desktop web browser to enter the final configuration information. The administrator determines the server is running in multi-user mode. The administrator verifies that a web browser is installed on the server and that it has a display manager installed. Which of the following commands will best allow the administrator to temporarily use the web browser on the server?

A.

sudo systemctl isolate graphical.target

A.

sudo systemctl isolate graphical.target

Answers
B.

sudo systemctl set-default runlevel5.target

B.

sudo systemctl set-default runlevel5.target

Answers
C.

sudo systemctl restart gdm

C.

sudo systemctl restart gdm

Answers
D.

sudo systemctl --no-wall rescue

D.

sudo systemctl --no-wall rescue

Answers
Suggested answer: A

Explanation:

The systemctl isolate graphical.target command switches the system to graphical mode (runlevel 5). This will start the display manager and allow the administrator to use a graphical environment, including a web browser. The switch is temporary, and the system will revert to multi-user mode after reboot unless explicitly changed.

Total 371 questions
Go to page: of 38