Practice Free XK0-005 Exam Online Questions
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:
Based on the output above, which of following is the MOST probable cause of the issue?
- 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.
D
Explanation:
The most probable cause of the connectivity issue is that the network interface cable is not connected to a switch. This can be inferred from the output of the ip link list dev eth0 command, which shows that the network interface eth0 has the NO-CARRIER flag set. This flag indicates that there is no physical link detected on the interface, meaning that the cable is either unplugged or faulty. The other options are not valid causes of the issue. The address ac:00:11:22:33:cd is a valid Ethernet address, as it follows the format of six hexadecimal octets separated by colons. The Ethernet broadcast address should be ff:ff:ff:ff:ff:ff, which is the default value for all interfaces. The network interface eth0 is not using an old kernel module, as it shows the UP flag, which indicates that the interface is enabled and ready to transmit data. CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 14: Managing Networking
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
- B . setfacl -x rwx/cloud_users
- C . setfacl -P rwx/cloud_users
- D . setfacl -m u:Oliver/cloud_users
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 systems administrator wants to check if the ntpd service is configured to start on startup.
Which of the following commands will show that information when run?
- A . systemctl is-active ntpd.service
- B . systemctl stop ntpd.service
- C . systemctl is-enabled ntpd.service
- D . systemctl start ntpd.service
C
Explanation:
To check whether a service is enabled to start on boot, the correct command is:
bash
systemctl is-enabled ntpd.service
is-enabled checks if the service is enabled (i.e., set to start at boot).
is-active checks the current running state, not the boot-time state.
stop and start are used to control the service, not check its boot status.
Reference from CompTIA Linux+ XK0-005 Official Study Guide, Domain 4.0 C System Management: “Use systemctl is-enabled to determine if a service is enabled at startup. Use systemctl is-active to determine if the service is currently running.”
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
- B . sudo systemctl set-default runlevel5.target
- C . sudo systemctl restart gdm
- D . sudo systemctl –no-wall rescue
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.
Users connecting to a MySQL database on a Linux system report frequent errors.
An administrator reviews the following partial output of the /proc/meminfo and free commands:
total used free
Mem: 1011966 151930 860036
Swap: 1191972 1181716 10256
MemTotal: 1011966 kB
MemFree:
SwapTotal: 1191972 kB
SwapFree: 10256 kB
Which of the following should the administrator do to ensure that the MySQL service will continue to run even if the system runs out of swap space? (Select two.)
- A . Issue the sysctl -w vm.overcommit_ratio=100 command.
- B . Issue the sysctl -w vm.overconunit_memory=2 command. (Invalid key)
- C . Issue the dd if=/dev/zero of=/swapfile bs=1024 count=65536 command.
- D . Issue the mkswap /dev/sda2; swapon -v /dev/sda2 command.
- E . Reload the /etc/fstab file by issuing the mount -a command. (Not sufficient alone)
- F . Use disk quotas on the swap space to prevent MySQL from overutilizing the swap partition.
C, D
Explanation:
To prevent MySQL from crashing when swap space is exhausted:
Option C creates an additional swap file.
Option D adds an extra swap partition or enables existing one.
Option A adjusts the overcommit behavior to allow more allocation under low-memory conditions.
Reference: CompTIA Linux+ XK0-005 Official Study Guide, Domain 4.0 C System Management
“Use dd to create swap files and mkswap/swapon to enable them. Modify vm.overcommit_ratio to adjust memory allocation policy, useful in managing memory under stress.”
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
- B . Add /bin/false entry to the /etc/shells file
- C . Make /bin/false an executable file
- D . Change the user’s default shell to /bin/bash
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.
A technician just fixed a few issues in some code and is ready to deploy the code into production.
Which of the following steps should the technician take next?
- A . Create a new branch using git checkout.
- B . Perform a git clone to pull main down.
- C . Create a git pull request to merge into main.
- D . Perform a git pull to update the local copy of the code.
C
Explanation:
After fixing issues in the code, the next step is to merge these changes into the main branch. This is
typically done by creating a pull request78.
:7(https://zeet.co/blog/deploy-to-production)8(https://stackoverflow.com/questions/11833511/git-
deploy-to-production)
A server administrator has scheduled a cron job to run YUM updates on all servers without manual intervention, but kernel packages must be excluded from the updates at all times.
Which of the following configuration files needs to be modified to make these changes persistent?
- A . /etc/yum.conf
- B . /etc/dnf/dnf.conf
- C . /etc/yum/pluginconf.d/packages.conf
- D . /etc/yum.repo.d/kernel.repo
A
Explanation:
The /etc/yum.conf file contains configuration settings for the YUM package manager. To exclude kernel updates, the administrator should add exclude=kernel* to the [main] section of this file. This ensures that all future YUM updates skip kernel packages, making the exclusion persistent.
A systems administrator needs to remove a disk from a Linux server. The disk size is 500G, and it is the only one that size on that machine.
Which of the following commands can the administrator use to find the corresponding device name?
- A . fdisk -V
- B . partprobe -a
- C . lsusb -t
- D . lsscsi -s
D
Explanation:
The lsscsi command can list the SCSI devices on the system, along with their size and device name. The -s option shows the size of each device. The administrator can look for the device that has a size of 500G and note its device name. See lsscsi(8) – Linux man page and How to check Disk Interface Types in Linux.
1: https://linux.die.net/man/8/lsscsi
2: https://www.golinuxcloud.com/check-disk-type-linux/
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 C-to-destination 192.0.2.25:3129
- C . iptables -t nat -I PREROUTING -p top –sport 80 -j DNAT C-to-destination 192.0.2.25:3129
- D . iptables -t nat -A PREROUTING -p tcp –dport 80 -j DNAT C-to-destination 192.0.2.25:3128
D
Explanation:
The command iptables -t nat -A PREROUTING -p tcp –dport 80 -j DNAT –to-destination