📘 Free XK0-005 Sample Questions
An administrator accidentally deleted the /boot/vmlinuz file and must resolve the issue before the server is
rebooted. Which of the following commands should the administrator use to identify the correct version of this
file?
A
rpm -qa | grep kernel; uname -a
B
.yum -y update; shutdown -r now
C
cat /etc/centos-release; rpm -Uvh --nodeps
D
telinit 1; restorecon -Rv /boot
Correct Answer:
A. rpm -qa | grep kernel; uname -a
Explanation:
The administrator can use the command "rpm -qa | grep kernel" to identify the installed kernel packages on
the system, and "uname -a" to display information about the current running kernel. The output of these
commands can be used to determine the correct version of the /boot/vmlinuz file that needs to be restored.
A cloud engineer needs to change the secure remote login port from 22 to 49000. Which of the following files
should the engineer modify to change the port number to the desired value?
A
./etc/host.conf
B
/etc/hostname
C
./etc/services
D
etc/ssh/sshd_config
Correct Answer:
D. etc/ssh/sshd_config
Explanation:
D. /etc/ssh/sshd_configThe file the engineer needs to modify is "/etc/ssh/sshd_config". This is the
configuration file for the SSH server and it controls various parameters for the server, including the port
number used for secure remote login. To change the port number from 22 to 49000, the engineer should
locate the line that starts with "Port 22" and change it to "Port 49000". After making the change, the engineer
should save the file and restart the SSH service for the changes to take effect.
A new file was added to a main Git repository. An administrator wants to synchronize a local copy with the
contents of the main repository. Which of the following commands should the administrator use for this task?
A
git reflog
B
git pull
C
git status
D
git push
Correct Answer:
B. git pull
Explanation:
B. git pullThe administrator should use the "git pull" command to synchronize the local repository with the
main repository. The "git pull" command fetches the latest changes from the remote repository and merges
them with the local repository. This will ensure that the local repository has the latest version of the code,
including the new file that was added to the main repository. Before running the "git pull" command, the
administrator should make sure that they are in the correct branch and that their local repository is in a clean
state (i.e., no changes have been made to the local repository since the last time it was synchronized with the
main repository).
A Linux administrator needs to redirect all HTTP traffic temporarily to the new proxy server 192.0.2.25 on port
3128. Which of the following commands will accomplish this task?
A
iptables -t nat -D PREROUTING -p tcp --sport 80 -j DNAT - -to-destination 192.0.2.25:3128
B
iptables -t nat -A PREROUTING -p top --dport 81 -j DNAT –-to-destination 192.0.2.25:3129
C
.iptables -t nat -I PREROUTING -p top --sport 80 -j DNAT –-to-destination 192.0.2.25:3129
D
.iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT –-to-destination 192.0.2.25:3128
Correct Answer:
D. .iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT –-to-destination 192.0.2.25:3128
Explanation:
iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT –-to-destination 192.0.2.25:3128.
Developers have requested implementation of a persistent, static route on the application server. Packets sent
over the interface eth0 to 10.0.213.5/32 should be routed via 10.0.5.1. Which of the following commands should the
administrator run to achieve this goal?
A
route -i etho -p add 10.0.213.5 10.0.5.1
B
route modify eth0 +ipv4.routes "10.0.213.5/32 10.0.5.1"
C
echo "10.0.213.5 10.0.5.1 eth0" > /proc/net/route
D
ip route add 10.0.213.5/32 via 10.0.5.1 dev eth0
Correct Answer:
D. ip route add 10.0.213.5/32 via 10.0.5.1 dev eth0
A user is asking the systems administrator for assistance with writing a script to verify whether a file exists. Given
the following:
A
.if [ -f "$filename" ]; then
B
if [ -d "$filename" ]; then
C
.if [ -f "$filename" ] then
D
.if [ -f "$filename" ]; while
Correct Answer:
A. .if [ -f "$filename" ]; then
Explanation:
"if [ -f "$filename" ]; then" is a shell script that tests for the existence of a file named "$filename". The syntax
of this command is as follows:"if" is a shell construct that allows you to execute a command or a series of
commands only if a certain condition is met."[ -f "$filename" ]" is a test command that returns true if
"$filename" is a regular file (i.e., not a directory or a symbolic link). The "-f" option is used to test for the
existence of a regular file. The "$filename" variable is enclosed in double quotes to allow for the possibility of
spaces in the file name."then" is a keyword that specifies the start of the commands to be executed if the test
is true.
DRAG DROP -
As a Systems Administrator, to reduce disk space, you were tasked to create a shell script that does the following:
Add relevant content to /tmp/script.sh, so that it finds and compresses related files in /var/log without recursion.
INSTRUCTIONS:
Drag and drop snippets to fill the blanks to build a script that performs the actual compression of rotated log files.
If at any time you would like to bring back the initial state of the simulation, please click the Reset All button.
A
Correct Answer:
A.
A systems administrator is deploying three identical, cloud-based servers. The administrator is using the following
code to complete the task:
A
Ansible
B
Puppet
C
Chef
D
.Terraform
Correct Answer:
D. .Terraform
Explanation:
In this example, Terraform is used to deploy an Amazon Web Services (AWS) EC2 instance. The first line of the
code defines the AWS provider, and the region attribute is set to "us-west-2".The second section of the code
defines the aws_instance resource. The ami attribute specifies the Amazon Machine Image (AMI) ID to use,
and the instance_type attribute specifies the type of instance to deploy. The tags attribute is used to add a
tag to the instance, with the key "Name" and the value "example-instance".This code is a simple example of
how Terraform can be used to deploy a cloud-based server. In a real-world scenario, the code would likely be
more complex and include additional resources and configuration options, such as security groups, subnets,
and more.
Which of the following technologies can be used as a central repository of Linux users and groups?
A
.LDAP
B
MFA
C
SSO
D
PAM
Correct Answer:
A. .LDAP
A systems administrator is troubleshooting connectivity issues and trying to find out why a Linux server is not able
to reach other servers on the same subnet it is connected to. When listing link parameters, the following is
presented:
A
The address ac:00:11:22:33:cd is not a valid Ethernet address.
B
The Ethernet broadcast address should be ac:00:11:22:33:ff instead.
C
The network interface eth0 is using an old kernel module
D
The network interface cable is not connected to a switch.
Correct Answer:
D. The network interface cable is not connected to a switch.
Explanation:
D. The network interface cable is not connected to a switch.The output shows that the state of the network
interface eth0 is "DOWN". This means that the interface is not currently transmitting or receiving data. The
"NO-CARRIER" status also suggests that the interface is not connected to a network.The most probable
cause of the issue is that the network interface cable is not connected to a switch, or that the switch the cable
is connected to is not functioning correctly. When a network interface is down, it usually means that there is
an issue with the physical or logical connection to the network.
Questions: 1-10 out of 225
Continue Full Practice..
GET ALL 225 QUESTIONS