XK0-004 Mock Test Free – 50 Realistic Questions to Prepare with Confidence.
Getting ready for your XK0-004 certification exam? Start your preparation the smart way with our XK0-004 Mock Test Free – a carefully crafted set of 50 realistic, exam-style questions to help you practice effectively and boost your confidence.
Using a mock test free for XK0-004 exam is one of the best ways to:
- Familiarize yourself with the actual exam format and question style
- Identify areas where you need more review
- Strengthen your time management and test-taking strategy
Below, you will find 50 free questions from our XK0-004 Mock Test Free resource. These questions are structured to reflect the real exam’s difficulty and content areas, helping you assess your readiness accurately.
A file server is sharing a directory called /share between team members inside a company. The fileshare needs to be moved from serverA to /newshare located on serverB with all permissions and attributes preserved. Which of the following commands would BEST achieve this task?
A. rsync -aHAX /share/* serverB:/newshare
B. dd if=/share/* of=serverB:/newshare
C. tar -cvf /share/* serverB:/newshare
D. mirrorlv /share/* serverB:/newshare
A company wants to ensure that all newly created files can be modified only by their owners and that all new directory content can be changed only by the creator of the directory. Which of the following commands will help achieve this task?
A. umask 0022
B. umask 0012
C. chmod ג€”R 0644 /
D. chmod ג€”R 0755 /
A systems administrator installs a simple package, but the Linux system returns the following error: rpmdb open fails. To verify if there is a problem in the RPM database, the systems administrator runs the following command:Which of the following commands should the systems administrator run NEXT to resolve this issue?
A. cd/var/lib/rpm; rpm –rebuilddb ; rm -f _db*; yum clean all
B. cd/var/lib/rpm; rpm -qd; rpm –rebuilddb; yum clean all
C. cd/var/lib/rpm; rpm -qa; rm -f _db*; yum clean all
D. cd/var/lib/rpm; rm -f _db*; rpm –rebuilddb; yum clean all
A systems administrator observes high latency values when reaching a remote web server. Which of the following commands will help determine and isolate issues on the network side?
A. mtr
B. dig
C. netstat
D. route
An administrator receives an alarm because the disk of one of the sewers is running out of space. Which of the following commands can be used to see the space that each partition is using?
A. df -h
B. du -scg /
C. fdisk -l
D. fsck /
A Linux administrator tried to copy files to a remote server but received an error message indicating a lack of free space on the disk. The administrator issued a df command and verified adequate free space and inodes on the filesystem. Which of the following commands is the BEST way to diagnose the issue?
A. cat /proc/meminfo
B. lsof -nP | grep deleted
C. find / -type f -size +50M
D. du -a / | sort -n -r | head -n 30
An administrator needs to create a shared directory in which all users are able to read, write, and execute its content but none of the regular users are able to delete any content. Which of the following permissions should be applied to this shared directory?
A. rwxrwxrwt
B. rwxrwxrws
C. rwxrwxrwx
D. rwxrwxrw*
A Linux administrator needs to know the MAC address of the server's gateway. Which of the following commands should the administrator run to obtain this information?
A. arp -gw
B. arp -a
C. arp -gwi
D. arp -gtw
A junior administrator needs to display information for an RPM package that contains software from an external provider. Which of the following commands will display the package information?
A. rpm -vp package.noarch.rpm
B. rpm -qp package.noarch.rpm
C. rpm -qf package.noarch.rpm
D. rpm -qi package.noarch.rpm
A Linux administrator is testing a new web application on a local laptop and consistently shows the following 403 errors in the laptop's logs:The web server starts properly, but an error is generated in the audit log. Which of the following settings should be enabled to prevent this audit message?
A. httpd_can_network_connect = 1
B. httpd_enable_scripting = 1
C. httpd_enable_homedirs = 1
D. httpd_enable_cgi = 1
After running an Nmap scan on a local area network, a penetration tester notices several older Linux servers have port 23 open. Which of the following should the systems administrator do as a security best practice?
A. Use a non-standard port for Telnet.
B. Disable and uninstall the Telnet service.
C. Ensure the kernels are up to date with the latest patches.
D. Configure the firewall to allow Telnet access only from trusted networks.
A Linux administrator built a GitLab server. Later that day, a software engineer tried to access the server to upload the repository during the final step of installation. The software engineer could not access the website. Which of the following firewall rules would allow access to this site?
A. iptables ג€”A INPUT ג€”p tcp ג€”m multiport –dports 80,443 ג€”m conntrack ג€”cstate NEW, ESTABLISHED ג€”j ACCEPT
B. iptables ג€”A INPUT ג€”p tcp ג€”m multiport –dports 80,443 ג€”m conntrack ג€”cstate ESTABLISHED ג€”j ACCEPT
C. iptables ג€”A INPUT ג€”p tcp ג€”m multiport –dports 80,443 ג€”m conntrack ג€”cstate RELATED, ESTABLISHED ג€”j ACCEPT
D. iptables ג€”A INPUT ג€”p tcp ג€”m multiport –dports 80,443 ג€”m conntrack ג€”cstate NEW, ESTABLISHED ג€”j REJECT
A Linux administrator needs to disable the Sendmail service on a Linux server and prevent it from being started manually and during boot. Which of the following is the BEST command to do this?
A. systemctl reset-failed sendmail
B. systemctl mask sendmail
C. systemctl stop sendmail
D. systemctl disable sendmail
A systems administrator is implementing disk quotas on /home. During the process, the administrator receives the following error: Cannot find filesystem to check or filesystem not mounted with user quota option. Which of the following is the correct order of steps the administrator should follow to resolve this error?
A. 1. Verify if /home has quotas enabled in /etc/fstab and, if not, enable it. 2. Remount /home. 3. Create the quota database files and generate the disk usage table. 4. Assign user quota policies.
B. 1. Create the quota database files and generate the disk usage table. 2. Verify if /home has quotas enabled in /etc/fstab and, if not, enable it. 3. Remount /home. 4. Assign user quota policies.
C. 1. Verify if /home has quotas enabled in /etc/fstab and, if not, enable it. 2. Create the quota database files and generate the disk usage table. 3. Remount /home. 4. Assign user quota policies.
D. 1. Assign user quota policies. 2. Verify if /home has quotas enabled in /etc/fstab and, if not, enable it. 3. Create the quota database files and generate the disk usage table. 4. Remount /home.
An administrator needs to deploy 100 identical CentOS workstations via PXE boot. Which of the following should the administrator use to minimize the amount of interaction with the consoles needed?
A. Kickstart script
B. Ghost image on a distribution server
C. Hard disk duplicator
D. Hard disk duplicator
E. Ubiquity script
A Linux administrator receives the following while attempting to remove a file:Which of the following commands will resolve the issue?
A. cattr -i test.txt
B. setfacl -m u:root:x test.txt
C. chmod -0775 test.txt
D. chcon -u system_u test.txt
A Linux administrator has installed a web application firewall in front of a web server running on HTTP port 8080 and successfully started the HTTP server. However, after opening the application URL in an Internet browser, the administrator discovered that the application does not work. The administrator performed the following diagnostic steps: Output of sysctl -a command:Output of iptables -L command:
Output of netstat `"nltop | grep "8080":
Which of the following is the NEXT step the administrator should perform to permanently fix the issue at the kernel level?
A. sysctl -w net.ipv4.ip_forward=1 then run sysctl -w /etc/sysctl.conf to enable the change
B. Edit /etc/sysctl.conf file and add net.ipv4.ip_forward = 1 then run sysctl -p /etc/sysctl.conf to enable the change
C. Add iptables rule iptables -A INPUT -m state –state NEW -p tcp –dport 8080 -j then restart httpd daemon
D. Add iptables rule iptables -A FORWARD-m state –state NEW -p tcp –dport 8080 ג€”j ACCEPT then restart httpd daemon
Which of the following will provide a list of all flash, external, internal, and SSD drives?
A. lspci
B. lsmod
C. lsblk
D. lsusb
A Linux administrator is developing a Bash script to close specific ports on a server firewall. The administrator is not certain of the default port for the Internet Message Access Protocol. Which of the following files should the administrator check to determine the default port?
A. /etc/network
B. /etc/default/ufw
C. /etc/resolv.conf
D. /etc/services
Which of the following is true about Type 2 hypervisors?
A. Type 2 hypervisors run on top of another general purpose OS.
B. Type 2 hypervisors are often called bare-metal or native hypervisors.
C. Type 2 hypervisors offer a performance increase to the guests in comparison to a Type 1 hypervisor.
D. Only Type 2 hypervisors allow direct access to CPU virtualization features.
A systems administrator receives a report that the web server is not running after a planned system reboot. After starting the web server manually, which of the following commands should the administrator issue to ensure the web server starts at boot time?
A. systemctl service on
B. systemctl enable .service
C. systemctl service enable
D. systemctl on .service
A Linux administrator needs to remotely update the contents of the www.comptia.org/contacts URL. Which of the following commands would allow the administrator to download the current contents of the URL before updating?
A. curl www.comptia.org/contacts
B. dig www.comptia.org/contacts
C. apt-get www.comptia.org/contacts
D. yum list www.comptia.org/contacts
A Linux administrator is helping the security team troubleshoot an SELinux policy violation incident. Which of the following would be the BEST utility command to display SELinux violation and AVC denial messages?
A. journalctl | grep sealert
B. sealert ג€”a /var/log/audit/audit.log
C. aureport | grep AVC
D. cat /var/log/messages | grep selinux
Ann, a junior systems administrator, is required to add a line to the /etc/yum.conf file. However, she receives the following error message when she tries to add the line:Ann performs some diagnostics to attempt to find the root cause:
Which of the following commands should Ann execute to write content to /etc/yum?
A. chmod 755 /etc/yum.conf
B. setfacl ג€”m m:rw /etc/yum.conf
C. chattr ג€”i /etc/yum.conf
D. setenforce 0
Which of the following default files are typically used to contain a list of public keys from other computers? (Choose two.)
A. ~/.ssh/authorized_keys
B. ~/.ssh/config
C. ~/.ssh/id_dsa.pub
D. ~/.ssh/known_hosts
E. ~/.ssh/id_rsa
F. ~/.ssh/id_rsa.pub
The following tools help maintain consistency across different systems in an infrastructure: SUSE Manager - Red Hat Satellite - Spacewalk - If a system file is changed, the tools roll back the file to a predefined configuration. Which of the following concepts BEST describes this behavior?
A. Build automation
B. Infrastructure as code
C. Automated configuration management
D. Agentless system management
The dracut command is used to:
A. create initial RAMDisk images for preloading modules.
B. compile the Linux kernel images used to boot the OS.
C. create the bootloader executable files.
D. create the Boot Manager configuration files.
A technical support engineer receives a ticket from a user who is trying to create a 1KB file in the /tmp directory and is getting the following error: No space left on device. The support engineer checks the /tmp directory, and it has 20GB of free space. Which of the following BEST describes a possible cause for this error?
A. The /tmp directory is not mounted.
B. The filesystem is formatted with a 4MB block size.
C. the filesystem ran out of inodes.
D. The /tmp directory has been set with an immutable attribute.
Which of the following are Linux desktop environments? (Choose two.)
A. X11
B. Wayland
C. SPICE
D. VNC
E. MATE
F. KDE
A systems administrator needs to install a new piece of hardware that requires a new driver. The driver should be manually installed. Which of the following describes the order of commands required to obtain module information, install the module, and check the log for any errors during module installation?
A. lsmod, modprobe, modinfo
B. modinfo, insmod, modprobe
C. modinfo, insmod, dmesg
D. lsmod, insmod, dmesg
A systems administrator is editing a service file for the web server. In order to continue testing, all web server processes must be shut down. The administrator accomplishes this with the following commands:Based on the command output above, which of the following BEST explains how this was accomplished?
A. Killing the parent process with -15 gives it a chance to kill all of the child processes.
B. The -15 signal will allow the kill command to automatically seek out all child processes and kill them as well.
C. The -15 signal tells the kill command to kill all processes matching the Apache string.
D. The -15 signal gracefully kills the process and all Its parent and child processes.
A Linux engineer is troubleshooting a newly added SCSI device for a Linux server that needed more disk space without rebooting. The engineer discovers that the new device is not visible by the Linux kernel in fdisk -l output. Which of the following commands should be used to rescan the entire SCSI bus?
A. echo “- – -” > /sys/class/scsi_host/host0/scan
B. echo ‘ ‘ > /sys/class/scsi_host/host0/scan
C. echo “- – -” > /sys/scsi/scsi_host/host0/scan
D. echo “scan” > /sys/class/scsi_host/host0/scan
Users in the payroll department are not configured to use DNS due to security concerns. The users ask the junior Linux administrator to configure their workstations to access the payroll server at 192.168.204.11 by the name `Payroll`. Which of the following commands should the administrator issue to meet this request?
A. echo ג€nameserver 192.168.204.11 #Payrollג€ >> /etc/resolv.conf
B. echo ג€net.ipv4.ip_dynaddr=192.168.204.11 Payrollג€ >> /etc/sysctl.conf
C. echo ג€192.168.204.11 Payrollג€ >> /etc/hosts
D. echo ‘IPADDR=ג€192.168.204.11ג€ #Payroll’ >> /etc/network/interface
An administrator is installing a Linux VM on a personal hypervisor. The administrator wants to have the VM's IP address on the same network as the hypervisor host so the VM has the same network properties as the physical interface of the host. To which of the following should the administrator set the network properties?
A. Host-only network
B. NAT network
C. Bridge network
D. Overlay network
A user receives an access_denied error when trying to modify a file, even though the file permissions are set to 777. Which of the following commands should be used to view additional file permissions?
A. getsebool
B. getenforce
C. ls -z
D. ps -z
A Linux administrator wants to configure log messages of critical or higher severity levels from the cron utility to be logged to the console. Which of the following will accomplish this objective?
A. Edit the /etc/logrotate.d/cron file to include the line cron.emerg.* /dev/console
B. Edit the /etc/rsyslog.conf file to include the line cron.emerg.* /dev/console
C. Edit the /etc/logrotate.conf file to include the line cron.emerg.* /dev/console
D. Edit the /etc/rsyslog.d/conf file to include the line cron.emerg.* /dev/console
A security audit concludes that an organization's database servers need to be hardened. As a result, an administrator obtains the following partial Nmap output from a database server.Which of the following commands should the administrator execute to mitigate security risks?
A. iptables -A INPUT -p tсp –dport 23 -j DROP
B. iptables -A OUTPUT -p udp –dport 123 -j DROP
C. iptables -A INPUT -p tcp –sport 23 -j ACCEPT
D. iptables -A INPUT -p tcp –dport 3306 -j ACCEPT
SIMULATION - A junior system administrator had trouble installing and running an Apache web server on a Linux server. You have been tasked with installing the Apache web server on the Linux server and resolving the issue that prevented the junior administrator from running Apache. INSTRUCTIONS - Install Apache and start the service. Verify that the Apache service is running with the defaults. Typing `help` in the terminal will show a list of relevant commands. If at any time you would like to bring back the initial state of the simulation, please click the Reset All button. CentOS Command Prompt -
An administrator is tasked with increasing the size of the volume /dev/vg/lv to 20GB. Which of the following BEST illustrates the steps the administrator should take?
A. vgextend ג€”L20G /dev/vg/lv; resizelv /dev/vg/lv
B. parted ג€”L20G /dev/vg/lv; remount /dev/vg/lv
C. mkfs ג€”L20G /dev/vg/lv; tune2fs /dev/vg/lv
D. lvextend ג€”L20G /dev/vg/lv; resize2fs /dev/vg/lv
A Linux systems administrator needs to copy the contents of a directory named `working` on the local working system to a folder /var/www/html on a server named `corporate-web`. Which of the following commands will allow the administrator to copy all the contents to the web server?
A. scp ג€”r working/* webuser@corporate-web:/var/www/html
B. tar working/* webuser@corporate-web:/var/www/html
C. cp ג€”r working/* webuser@corporate-web:/var/www/html
D. mv working webuser@corporate-web:/var/www/html
After cloning a remote repository, a new feature of that project needs to be developed and integrated into the next major release. Which of the following is the first Git operation to run to begin working on this new feature immediately after the clone?
A. merge
B. init
C. diff
D. branch
Which of the following is the purpose of the vmlinux file on a Linux system?
A. To prevent a Linux kernel panic
B. To start a Linux virtual machine
C. To provide the executable kernel for the system
D. To enable resource access to the network
A technician wants to secure a sensitive workstation by ensuring network traffic is kept within the local subnet. To accomplish this task, the technician executes the following command: echo 0 > /proc/sys/net/ipv4/ip_default_ttl Which of the following commands can the technician use to confirm the expected results? (Choose two.)
A. tcpdump
B. traceroute
C. route
D. iperf
E. ip
F. arp
Which of the following protocols are used to access the desktop environment on a remote system? (Choose two.)
A. CUPS
B. Cinnamon
C. NX
D. SPICE
E. YAML
F. Kerberos
Which of the following boot methods can a Linux administrator use to boot a Linux server remotely via a network interface card instead of a local disk?
A. NTP
B. PXE
C. NFS
D. Kickstart
An engineer is working on a production application deployment that requires changing a web application property file called server.property that is managed by the Git version control system. A cloned copy of the remote repository in which the server.property file exists is on the local desktop computer. The engineer makes appropriate changes to the files, saves it as server.property, and executes git commit `"m `changed the property file` server.property. Which of the following commands did the engineer fail to perform?
A. git init server.property
B. git merge server.property
C. git add server.property
D. git push server.property
A technician wants to secure a sensitive workstation by ensuring network traffic is kept within the local subnet. To accomplish this task, the technician executes the following command: echo 0 > /proc/sys/net/ipv4/ip_default_ttl Which of the following commands can the technician use to confirm the expected results? (Choose two.)
A. tcpdump
B. traceroute
C. route
D. iperf
E. ip
F. arp
In a Linux system the first stage of the boot process is a hardware test using the BIOS. Once the hardware test is completed, control is passed to UEFI to begin the first-stage Linux boot process. To which of the following categories does UEFI belong?
A. Software
B. Device driver
C. Firmware
D. Hardware
An administrator received a request from a security officer to eliminate a blacklisting set called internal-blocked the company is using in the iptables firewall. Which of the following commands will complete the task?
A. ipset swap internal-blocked none
B. ipset destroy internal-blocked
C. ipset del internal-blocked
D. ipset remove internal-blocked
An administrator receives a USB drive and wants to make an exact copy of the disk before starting to work on it. One of the partitions on the USB drive was mounted as /dev/sdc1. Which of the following commands should the administrator use?
A. dd if=/dev/sdc of=~/usb_copy.img bs=512
B. dd if=/dev/sdc1 of=~/usb_copy.img count=1024
C. dd if=/dev/sdc1 of=~/usb_copy.img bs=1024
D. dd of=/dev/sdc if=~/usb_copy.img bs=1M
Access Full XK0-004 Mock Test Free
Want a full-length mock test experience? Click here to unlock the complete XK0-004 Mock Test Free set and get access to hundreds of additional practice questions covering all key topics.
We regularly update our question sets to stay aligned with the latest exam objectives—so check back often for fresh content!
Start practicing with our XK0-004 mock test free today—and take a major step toward exam success!