ExamGecko
Home Home / CompTIA / XK0-005

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

Question list
Search
Search

List of questions

Search

Related questions











A Linux administrator is enabling root log-in over SSH on a server. Which of the following combinations of files and parameters should the administrator modify to accomplish this task?

A.

/etc/ssh/ssh_config - PermitRootLogin

A.

/etc/ssh/ssh_config - PermitRootLogin

Answers
B.

/etc/ssh/ssh_config - AllowRootLogin

B.

/etc/ssh/ssh_config - AllowRootLogin

Answers
C.

/etc/ssh/sshd_config - PermitRootLogin

C.

/etc/ssh/sshd_config - PermitRootLogin

Answers
D.

/etc/ssh/sshd_config - AllowRootLogin

D.

/etc/ssh/sshd_config - AllowRootLogin

Answers
Suggested answer: C

Explanation:

To enable root login over SSH, the administrator must edit the /etc/ssh/sshd_config file, which configures the SSH daemon. The PermitRootLogin directive should be set to yes to allow root login. After making this change, the SSH daemon must be restarted for the changes to take effect.

An administrator changed the default port of an SSH server to 2222 on myhost, and clients are not able to connect. The administrator runs some commands and receives the following output:

vbnet

Copy code

$ ssh -p 2222 myhost

ssh:connect to host myhost on port 2222: No route to host

Which of the following commands should be run on myhost?

A.

firewall-cmd --zone=public --add-service=ssh

A.

firewall-cmd --zone=public --add-service=ssh

Answers
B.

firewall-cmd --zone=public --add-port=2222

B.

firewall-cmd --zone=public --add-port=2222

Answers
C.

iptables --zone=public --add-service=ssh

C.

iptables --zone=public --add-service=ssh

Answers
D.

iptables --zone=public --add-port=2222

D.

iptables --zone=public --add-port=2222

Answers
Suggested answer: B

Explanation:

The administrator has likely updated the SSH server to listen on a non-standard port (2222), but the firewall rules were not updated to allow connections on this new port. The firewall-cmd command with the --add-port option allows traffic on a specific port through the firewall. The command should be executed on myhost to permit incoming SSH connections on port 2222.

An administrator wants to execute a long-running script in the terminal while troubleshooting another issue. Which of the following options will achieve this goal?

A.

bash script.sh &

A.

bash script.sh &

Answers
B.

source script.sh

B.

source script.sh

Answers
C.

sh script.sh | jobs

C.

sh script.sh | jobs

Answers
D.

nice -10 ./script.sh

D.

nice -10 ./script.sh

Answers
Suggested answer: A

Explanation:

Running a command with & at the end sends it to the background, allowing the administrator to continue using the terminal for other tasks while the script runs. This is useful for long-running scripts that do not require immediate attention but need to keep running.

A Linux administrator is investigating the reason a systemd timer is not running every night at midnight. The administrator sees the following unit file:

[Unit]

Description=Execute backup every day at midnight

[Timer]

OnCalendar=--01 00:00:00

Unit=backup.service

RandomizedDelaySec=10800

[Install]

WantedBy=multi-user.target

Which of the following modifications should the administrator make in the unit file? (Select two).

A.

Remove RandomizedDelaySec=10800.

A.

Remove RandomizedDelaySec=10800.

Answers
B.

Add WakeSystem=Midnight.

B.

Add WakeSystem=Midnight.

Answers
C.

Change OnCalendar to 00:00:00.

C.

Change OnCalendar to 00:00:00.

Answers
D.

Add OnCalendar=--* daily.

D.

Add OnCalendar=--* daily.

Answers
E.

Add AccuracySec=1.

E.

Add AccuracySec=1.

Answers
F.

Remove OnCalendar=--01 00:00:00.

F.

Remove OnCalendar=--01 00:00:00.

Answers
Suggested answer: A

Explanation:

The RandomizedDelaySec parameter delays the timer by a random time within the specified seconds, which can be up to 3 hours in this case. Removing it will ensure the timer triggers at exactly midnight. Additionally, using OnCalendar=--* daily correctly schedules the timer to run every day at midnight.

A Linux systems administrator needs to compress a file named passwords.txt. The compressed file should be saved as passwords.txt.gz. Which of the following commands should the administrator use to accomplish this task?

A.

gzip -c passwords.txt > passwords.txt.gz

A.

gzip -c passwords.txt > passwords.txt.gz

Answers
B.

gzip -d passwords.txt | passwords.txt.gz

B.

gzip -d passwords.txt | passwords.txt.gz

Answers
C.

gzip -n passwords.txt > passwords.txt.gz

C.

gzip -n passwords.txt > passwords.txt.gz

Answers
D.

gzip -n passwords.txt < passwords.txt.gz

D.

gzip -n passwords.txt < passwords.txt.gz

Answers
Suggested answer: A

Explanation:

The gzip command with the -c flag outputs the compressed data to standard output, which can then be redirected to create a .gz file. This approach maintains the original file while creating a compressed version.

Users are reporting that a Linux server is responding slowly. A systems administrator troubleshooting the server issue sees the following iostat output, with %iowait at 50.38. Which of the following is most likely the issue?

A.

The CPU is mostly waiting for I/O operations.

A.

The CPU is mostly waiting for I/O operations.

Answers
B.

/ filesystem does not have enough storage allocated.

B.

/ filesystem does not have enough storage allocated.

Answers
C.

/var filesystem is almost full.

C.

/var filesystem is almost full.

Answers
D.

The CPU capacity is inadequate.

D.

The CPU capacity is inadequate.

Answers
Suggested answer: A

Explanation:

The %iowait value represents the percentage of time the CPU is waiting for I/O operations to complete. A high %iowait value suggests the system is bottlenecked by disk I/O, which could lead to slow response times. Addressing disk I/O bottlenecks would improve performance.


A diagnostic tool reports a 'host seems down' event for a server with an IP address of 192.168.47.44. Which of the following commands should the administrator use to confirm the host down event?

A.

nmap 192.168.47.0/32

A.

nmap 192.168.47.0/32

Answers
B.

netcat 192.168.47.44

B.

netcat 192.168.47.44

Answers
C.

nmap 192.168.47.44 -Pn

C.

nmap 192.168.47.44 -Pn

Answers
D.

ping -c 1 192.168.47.44

D.

ping -c 1 192.168.47.44

Answers
Suggested answer: D

Explanation:

The ping -c 1 192.168.47.44 command sends one ICMP echo request to the specified host to check its availability. If the host is down, there will be no response. This is the quickest way to confirm if a host is reachable. nmap -Pn can also be used to check a host status, but ping is faster and lighter.

A Linux engineer wants to give read-write-execute permissions for the cloud_users directory to user Oliver. Which of the following commands should the engineer use?

A.

setfacl -L Oliver /cloud_users

A.

setfacl -L Oliver /cloud_users

Answers
B.

setfacl -x rwx /cloud_users

B.

setfacl -x rwx /cloud_users

Answers
C.

setfacl -P rwx /cloud_users

C.

setfacl -P rwx /cloud_users

Answers
D.

setfacl -m u:Oliver /cloud_users

D.

setfacl -m u:Oliver /cloud_users

Answers
Suggested answer: D

Explanation:

The setfacl -m u:Oliver:rwx /cloud_users command modifies the ACL (Access Control List) for the directory cloud_users, granting the user Oliver read, write, and execute permissions. This is the correct syntax for assigning specific permissions to a user.

A Linux systems administrator is updating code. After completing the update, the administrator wants to publish the updated code without including the configuration files. Which of the following should the administrator use to accomplish this task?

A.

git clone

A.

git clone

Answers
B.

git -

B.

git -

Answers
C.

.gitignore

C.

.gitignore

Answers
D.

git fetch

D.

git fetch

Answers
Suggested answer: C

Explanation:

The .gitignore file is used in Git to specify which files or directories should be ignored in a repository. By listing configuration files in the .gitignore file, the administrator ensures they are not included in any future commits or pushes to the remote repository. This is essential when dealing with sensitive or environment-specific files that should not be shared or deployed.

A Linux administrator is creating a user that can run the FTP service but cannot log in to the system. The administrator sets /bin/false as a login shell for the user. When the user tries to run the FTP service, it is rejected with an 'invalid shell: /bin/false' message. Which of the following is the best way to resolve the issue?

A.

Change ownership of /bin/false to the FTP user

A.

Change ownership of /bin/false to the FTP user

Answers
B.

Add /bin/false entry to the /etc/shells file

B.

Add /bin/false entry to the /etc/shells file

Answers
C.

Make /bin/false an executable file

C.

Make /bin/false an executable file

Answers
D.

Change the user's default shell to /bin/bash

D.

Change the user's default shell to /bin/bash

Answers
Suggested answer: B

Explanation:

The /etc/shells file contains a list of valid login shells. Since /bin/false is not listed as a valid shell, adding it to the /etc/shells file will resolve the issue and allow the user to run the FTP service without being able to log into the system interactively.

Total 371 questions
Go to page: of 38