XK0-005 Practice Exam Free – 50 Questions to Simulate the Real Exam
Are you getting ready for the XK0-005 certification? Take your preparation to the next level with our XK0-005 Practice Exam Free – a carefully designed set of 50 realistic exam-style questions to help you evaluate your knowledge and boost your confidence.
Using a XK0-005 practice exam free is one of the best ways to:
- Experience the format and difficulty of the real exam
- Identify your strengths and focus on weak areas
- Improve your test-taking speed and accuracy
Below, you will find 50 realistic XK0-005 practice exam free questions covering key exam topics. Each question reflects the structure and challenge of the actual exam.
While inspecting a recently compromised Linux system, the administrator identified a number of processes that should not have been running:Which of the following commands should the administrator use to terminate all of the identified processes?
A. pkill -9 -f “upload*.sh”
B. kill -9 “upload*.sh”
C. killall -9 “upload*.sh”
D. skill -9 “upload*.sh”
A Linux administrator found many containers in an exited state. Which of the following commands will allow the administrator to clean up the containers in an exited state?
A. docker rm –all
B. docker rm $(docker ps -aq)
C. docker images prune *
D. docker rm –state exited
A systems administrator created a web server for the company and is required to add a tag for the API so end users can connect. Which of the following would the administrator do to complete this requirement?
A. hostnamectl status –no-ask-password
B. hostnamectl set-hostname “$(perl -le “print” “A” x 86)”
C. hostnamectl set-hostname Comptia-WebNode -H root@192.168.2.14
D. hostnamectl set-hostname Comptia-WebNode –transient
A Linux administrator created the directory /project/access2all. By creating this directory, the administrator is trying to avoid the deletion or modification of files from non-owners. Which of the following will accomplish this goal?
A. chmod +t /project/access2all
B. chmod +rws /project/access2all
C. chmod 2770 /project/access2all
D. chmod ugo+rwx /project/access2all
Based on an organization’s new cybersecurity policies, an administrator has been instructed to ensure that, by default, all new users and groups that are created fall within the specified values below.To which of the following configuration files will the required changes need to be made?
A. /etc/login.defs
B. /etc/security/limits.conf
C. /etc/default/useradd
D. /etc/profile
An administrator needs to make an application change via a script that must be run only in console mode. Which of the following best represents the sequence the administrator should execute to accomplish this task?
A. systemctl isolate multi-user.targetsh script.shsystemctl isolate graphical.target
B. systemctl isolate graphical.targetsh script.shsystemctl isolate multi-user.target
C. sh script.shsystemctl isolate multi-user.targetsystemctl isolate graphical.target
D. systemctl isolate multi-user.targetsystemctl isolate graphical.targetsh script.sh
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
A Linux engineer needs to block an incoming connection from the IP address 2.2.2.2 to a secure shell server and ensure the originating IP address receives a response that a firewall is blocking the connection. Which of the following commands can be used to accomplish this task?
A. iptables -A INPUT -p tcp –dport ssh -s 2.2.2.2 -j DROP
B. iptables -A INPUT -p tcp –dport ssh -s 2.2.2.2 -j RETURN
C. iptables -A INPUT -p tcp –dport ssh -s 2.2.2.2 -j REJECT
D. iptables -A INPUT -p tcp –dport ssh -s 2.2.2.2 -j QUEUE
One leg of an LVM-mirrored volume failed due to the underlying physical volume, and a systems administrator is troubleshooting the issue. The following output has been provided:Given this scenario, which of the following should the administrator do to recover this volume?
A. Reboot the server. The volume will automatically go back to linear mode.
B. Replace the failed drive and reconfigure the mirror.
C. Reboot the server. The volume will revert to stripe mode.
D. Recreate the logical volume.
A systems administrator is notified that the mysqld process stopped unexpectedly. The systems administrator issues the following command: sudo grep –i -r ‘out of memory’ /var/log The output of the command shows the following: kernel: Out of memory: Kill process 9112 (mysqld) score 511 or sacrifice child. Which of the following commands should the systems administrator execute NEXT to troubleshoot this issue? (Select two).
A. free -h
B. nc -v 127.0.0.1 3306
C. renice -15 $( pidof mysql )
D. lsblk
E. killall -15
F. vmstat -a 1 4
A Linux administrator is tasked with adding users to the system. However, the administrator wants to ensure the users’ access will be disabled once the project is over. The expiration date should be 2021-09-30. Which of the following commands will accomplish this task?
A. sudo useradd -e 2021-09-30 Project_user
B. sudo useradd -c 2021-09-30 Project_user
C. sudo modinfo -F 2021-09-30 Project_uses
D. sudo useradd -m -d 2021-09-30 Project_user
A Linux administrator was asked to run a container with the httpd server inside. This container should be exposed at port 443 of a Linux host machine while it internally listens on port 8443. Which of the following commands will accomplish this task?
A. podman run -d -p 443:8443 httpd
B. podman run -d -p 8443:443 httpd
C. podman run –d -e 443:8443 httpd
D. podman exec -p 8443:443 httpd
A Linux administrator wants to find out whether files from the wget package have been altered since they were installed. Which of the following commands will provide the correct information?
A. rpm -i wget
B. rpm -qf wget
C. rpm -F wget
D. rpm -V wget
The application team has reported latency issues that are causing the application to crash on the Linux server. The Linux administrator starts troubleshooting and receives the following output:Which of the following commands will improve the latency issue?
A. # echo ‘net.core.net_backlog = 5000000’ >> /etc/sysctl.conf# sysctl -p# systemctl daemon-reload
B. # ifdown eth0# ip link set dev eth0 mtu 800# ifup eth0
C. # systemctl stop network# ethtool -g eth0 512# systemctl start network
D. # echo ‘net.core.rmem_max = 12500000’ >> /etc/sysctl.conf# echo ‘net.core.wmem_max = 12500000’ >> /etc/sysctl.conf# sysctl -p
A Linux administrator booted up the server and was presented with a non-GUI terminal. The administrator ran the command systemctl isolate graphical.target and rebooted the system by running systemctl reboot, which fixed the issue. However, the next day the administrator was presented again with a non-GUI terminal. Which of the following is the issue?
A. The administrator did not reboot the server properly.
B. The administrator did not set the default target to basic.target.
C. The administrator did not set the default target to graphical.target.
D. The administrator did not shut down the server properly.
A Linux administrator is adding a new configuration file to a Git repository. Which of the following describes the correct order of Git commands to accomplish the task successfully?
A. pull -> push -> add -> checkout
B. pull -> add -> commit -> push
C. checkout -> push -> add -> pull
D. pull -> add -> push -> commit
A DevOps engineer needs to download a Git repository from https://git.company.com/admin/project.git. Which of the following commands will achieve this goal?
A. git clone https://git.company.com/admin/project.git
B. git checkout https://git.company.com/admin/project.git
C. git pull https://git.company.com/admin/project.git
D. git branch https://git.company.com/admin/project.git
A Linux systems administrator is configuring a new filesystem that needs the capability to be mounted persistently across reboots. Which of the following commands will accomplish this task? (Choose two.)
A. df -h /data
B. mkfs.ext4 /dev/sdc1
C. fsck /dev/sdc1
D. fdisk -l /dev/sdc1
E. echo “/data /dev/sdc1 ext4 defaults 0 0” >> /etc/fstab
F. echo “/dev/sdc1 /data ext4 defaults 0 0” >> /etc/fstab
A Linux administrator needs to resolve a service that has failed to start. The administrator runs the following command:The following output is returned
Which of the following is MOST likely the issue?
A. The service does not have permissions to read write the startupfile.
B. The service startupfile size cannot be 81k.
C. The service startupfile cannot be owned by root.
D. The service startupfile should not be owned by the root group.
A Linux administrator is troubleshooting the root cause of a high CPU load and average.Which of the following commands will permanently resolve the issue?
A. renice -n -20 6295
B. pstree -p 6295
C. iostat -cy 1 5
D. kill -9 6295
An administrator needs to make some changes in the IaC declaration templates. Which of the following commands would maintain version control?
A. git clone https://github.com/comptia/linux+-.gitgit push origin
B. git clone https://qithub.com/comptia/linux+-.gitgit fetch New-Branch
C. git clone https://github.com/comptia/linux+-.gitgit status
D. git clone https://github.com/comptia/linuxt+-.gitgit checkout -b
A systems administrator is troubleshooting a connectivity issue pertaining to access to a system named db.example.com. The system IP address should be 192.168.20.88. The administrator issues the dig command and receives the following output:The administrator runs grep db.example.com /etc/hosts and receives the following output:
Given this scenario, which of the following should the administrator do to address this issue?
A. Modify the /etc/hosts file and change the db.example.com entry to 192.168.20.89.
B. Modify the /etc/network file and change the db.example.com entry to 192.168.20.88.
C. Modify the /etc/network file and change the db.example.com entry to 192.168.20.89.
D. Modify the /etc/hosts file and change the db.example.com entry to 192.168.20.88.
A systems administrator wants to be sure the sudo rules just added to /etc/sudoers are valid. Which of the following commands can be used for this task?
A. visudo -c
B. test -f /etc/sudoers
C. sudo vi check
D. cat /etc/sudoers | tee test
A Linux system is failing to boot. The following error is displayed in the serial console: [[1;33mDEPEND[Om] Dependency failed for /data. [[1;33mDEPEND[Om] Dependency failed for Local File Systems ... Welcome to emergency mode! After logging in, type "journalctl -xb" to viewsystem logs, "systemctl reboot" to reboot, "systemctl default" to try again to boot into default mode. Give root password for maintenance (or type Control-D to continue} Which of the following files will need to be modified for this server to be able to boot again?
A. /etc/mtab
B. /dev/sda
C. /etc/fstab
D. /ete/grub.conf
Users have reported that the interactive sessions were lost on a Linux server. A Linux administrator verifies the server was switched to rescue.target mode for maintenance. Which of the following commands will restore the server to its usual target?
A. telinit 0
B. systemctl reboot
C. systemctl get-default
D. systemctl emergency
A Linux administrator created a new file system. Which of the following files must be updated to ensure the filesystem mounts at boot time?
A. /etc/sysctl
B. /etc/filesystems
C. /etc/fstab
D. /etc/nfsmount.conf
A systems administrator is deploying three identical, cloud-based servers. The administrator is using the following code to complete the task:Which of the following technologies is the administrator using?
A. Ansible
B. Puppet
C. Chef
D. Terraform
A user is unable to log on to a Linux workstation. The systems administrator executes the following command:The command results in the following output:
Which of the following should the systems administrator execute to fix the issue?
A. chown -R user1:user1 /home/user1
B. sed -i ‘/:::/::/g’ /etc/shadow
C. chgrp user1:user1 /home/user1
D. passwd -u user1
A Linux administrator recently downloaded a software package that is currently in a compressed file. Which of the following commands will extract the files?
A. unzip -v
B. bzip2 -z
C. gzip
D. funzip
Which of the following commands is used to configure the default permissions for new files?
A. setenforce
B. sudo
C. umask
D. chmod
A Linux administrator generated a list of users who have root-level command-line access to the Linux server to meet an audit requirement. The administrator analyzes the following /etc/passwd and /etc/sudoers files:Which of the following users, in addition to the root user, should be listed in the audit report as having root-level command-line access? (Choose two.)
A. Carl
B. Lee
C. Mallory
D. Eve
E. Bob
F. Alice
Some servers in an organization have been compromised. Users are unable to access to the organization’s web page and other services. While reviewing the system log, a systems administrator notices messages from the kernel regarding firewall rules:Which of the following commands will remediate and help resolve the issue?
A.
B.
C.
D.
A Linux user is trying to execute commands with sudo but is receiving the following error: $ sudo visudo >>> /etc/sudoers: syntax error near line 28 <<< sudo: parse error in /etc/sudoers near line 28 sudo: no valid sudoers sources found, quitting The following output is provided: # grep root /etc/shadow root:*LOCK*:14600:::::: Which of the following actions will resolve this issue?
A. Log in directly using the root account and comment out line 28 from /etc/sudoers.
B. Boot the system in single user mode and comment out line 28 from /etc/sudoers.
C. Comment out line 28 from /etc/sudoers and try to use sudo again.
D. Log in to the system using the other regular user, switch to root, and comment out line 28 from /etc/sudoers.
As part of the requirements for installing a new application, the swappiness parameter needs to be changed to 0. This change needs to persist across reboots and be applied immediately. A Linux systems administrator is performing this change. Which of the following steps should the administrator complete to accomplish this task?
A. echo “vm.swappiness=0” >> /etc/sysctl.conf && sysctl -p
B. echo “vm.swappiness=0” >> /proc/meminfo && sysctl -a
C. sysctl -v >> /proc/meminfo && echo “vm.swapiness=0”
D. sysctl -h “vm.swapiness=0” && echo /etc/vmswapiness
A user generated a pair of private-public keys on a workstation. Which of the following commands will allow the user to upload the public key to a remote server and enable passwordless login?
A. scp ~/.ssh/id_rsa user@server:~/
B. rsync ~ /.ssh/ user@server:~/
C. ssh-add user server
D. ssh-copy-id user@server
An administrator started a long-running process in the foreground that needs to continue without interruption. Which of the following keystrokes should the administrator use to continue running the process in the background?
A. bg
B. bg
C. jobs -1
D. bg &
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
A Linux user reported the following error after trying to connect to the system remotely: ssh: connect to host 10.0.1.10 port 22: Resource temporarily unavailable The Linux systems administrator executed the following commands in the Linux system while trying to diagnose this issue:Which of the following commands will resolve this issue?
A. firewall-cmd –zone=public –permanent –add-service=22
B. systemctl enable firewalld; systemctl restart firewalld
C. firewall-cmd –zone=public –permanent –add-service=ssh
D. firewall-cmd –zone=public –permanent –add-port=22/udp
A cloud engineer needs to check the link status of a network interface named eth1 in a Linux server. Which of the following commands can help to achieve the goal?
A. ifconfig hw eth1
B. netstat -r eth1
C. ss -ti eth1
D. ip link show eth1
A cloud engineer needs to launch a container named web-01 in background mode. Which of the following commands will accomplish this task?
A. docker builder -f –name web-01 httpd
B. docker load –name web-01 httpd
C. docker ps -a –name web-01 httpd
D. docker run -d –name web-01 httpd
An administrator transferred a key for SSH authentication to a home directory on a remote server. The key file was moved to .ssh/authorized_keys location in order to establish SSH connection without a password. However, the SSH command still asked for the password. Given the following output:Which of the following commands would resolve the issue?
A. restorecon .ssh/authorized_keys
B. ssh_keygen -t rsa -o .ssh/authorized_keys
C. chown root:root .ssh/authorized_keys
D. chmod 600 .ssh/authorized_keys
A systems administrator wants to list all local accounts in which the UID is greater than 500. Which of the following commands will give the correct output?
A. find /etc/passwd -size +500
B. cut -d: -f1 /etc/passwd > 500
C. awk -F: ‘$3 > 500 {print $1}’ /etc/passwd
D. sed ‘/UID/’ /etc/passwd < 500
A developer wants to ensure that all files and folders created inside a shared folder named /Group00DEV inherit the group name of the parent folder. Which of the following commands will help achieve this goal?
A. chmod g+x /Group00DEV/
B. chmod g+w /Group00DEV/
C. chmod g+r /Group00DEV/
D. chmod g+s /Group00DEV/
A systems administrator made some changes in the ~/.bashrc file and added an alias command. When the administrator tried to use the alias command, it did not work. Which of the following should be executed FIRST?
A. source ~/.bashrc
B. read ~/.bashrc
C. touch ~/.bashrc
D. echo ~/.bashrc
A Linux engineer is setting the sticky bit on a directory called devops with 755 file permission. Which of the following commands will accomplish this task?
A. chown -s 755 devops
B. chown 1755 devops
C. chmod -s 755 devops
D. chmod 1755 devops
User1 is a member of the accounting group. Members of this group need to be able to execute but not make changes to a script maintained by User2. The script should not be accessible to other users or groups. Which of the following will give proper access to the script?
A. chown user2:accounting script.shchmod 750 script.sh
B. chown user1:accounting script.shchmod 777 script.sh
C. chown accounting:user1 script.shchmod 057 script.sh
D. chown user2:accounting script.shchmod u+x script.sh
A systems administrator installed a new software program on a Linux server. When the systems administrator tries to run the program, the following message appears on the screen.Which of the following commands will allow the systems administrator to check whether the system supports virtualization?
A. dmidecode -s system-version
B. lscpu
C. sysctl -a
D. cat /sys/device/system/cpu/possible
A Linux administrator modified the SSH configuration file. Which of the following commands should be used to apply the configuration changes?
A. systemctl stop sshd
B. systemctl mask sshd
C. systemctl reload sshd
D. systemctl start sshd
A Linux administrator is troubleshooting an issue in which an application service failed to start on a Linux server. The administrator runs a few commands and gets the following outputs:Based on the above outputs, which of the following is the MOST likely action the administrator should take to resolve this issue?
A. Enable the logsearch.service and restart the service.
B. Increase the TimeoutStartUSec configuration for the logsearch.sevice.
C. Update the OnCalendar configuration to schedule the start of the logsearch.service.
D. Update the KillSignal configuration for the logsearch.service to use TERM.
A Linux system is getting an error indicating the root filesystem is full. Which of the following commands should be used by the systems administrator to resolve this issue? (Choose three.)
A. df -h /
B. fdisk -1 /dev/sdb
C. growpart /dev/mapper/rootvg-rootlv
D. pvcreate /dev/sdb
E. lvresize –L +10G -r /dev/mapper/rootvg-rootlv
F. lsblk /dev/sda
G. parted -l /dev/mapper/rootvg-rootlv
H. vgextend /dev/rootvg /dev/sdb
Free Access Full XK0-005 Practice Exam Free
Looking for additional practice? Click here to access a full set of XK0-005 practice exam free questions and continue building your skills across all exam domains.
Our question sets are updated regularly to ensure they stay aligned with the latest exam objectives—so be sure to visit often!
Good luck with your XK0-005 certification journey!