XK0-006
Free XK0-006 practice questions
10 questions from our XK0-006 practice tests, each with the correct answer and a written explanation. Read them with the answers shown, or switch to quiz mode and answer first.
Question 1 of 10, System Management
A nightly job must mirror /srv/www to a backup host, copying only changed files, preserving ownership and timestamps, and deleting files on the destination that were removed at the source. Which command meets these requirements?
- Arsync -av /srv/www/ backup:/srv/www/
- Brsync -av --delete /srv/www/ backup:/srv/www/ Correct answer
- Ccp -au /srv/www/ /mnt/backup/www/
- Drsync -avz --ignore-existing /srv/www/ backup:/srv/www/
Answer and explanation: rsync -a preserves ownership, permissions and times, transfers only differences, and --delete removes destination files that no longer exist at the source. --ignore-existing skips files already at the destination so changed files are never updated and nothing is deleted, rsync without --delete leaves stale files behind, and cp -u to a local mount neither reaches a remote host efficiently nor deletes removed files.
Question 2 of 10, System Management
A new data disk must be mounted at /data on every boot, and the device name may change between /dev/sdb and /dev/sdc after hardware changes. What is the BEST way to reference the file system in /etc/fstab?
- AUse UUID=<file system UUID> as reported by blkid Correct answer
- BUse the PARTUUID of the disk's first partition with the defaults option
- CUse the kernel device name /dev/sdb1 and add the nofail option
- DUse LABEL=data after setting it with the partprobe command
Answer and explanation: A file system UUID is stable regardless of which kernel name the disk receives, so it is the recommended fstab identifier. The kernel name can change and nofail only hides the problem, a PARTUUID works but identifies the partition rather than the file system and is not the usual choice for a simple data disk, and partprobe re-reads partition tables rather than setting labels (e2label or xfs_admin do that).
Question 3 of 10, Services and User Management. Choose 2.
A rootless Podman container running as user appsvc must start automatically at boot, before appsvc logs in, and be managed as a systemd service. Which actions are required? (Choose two.)
- ASet the container restart policy to always with podman update
- BInstall the unit in /etc/systemd/system as root
- CAdd the container to /etc/rc.local with podman start
- DCreate a Quadlet .container file in ~/.config/containers/systemd/ Correct answer
- ERun loginctl enable-linger appsvc Correct answer
Answer and explanation: A Quadlet file in the user's containers/systemd directory is turned into a user service by the systemd generator, and lingering keeps the user's systemd manager running from boot without a login. rc.local is legacy and not enabled by default, a restart policy does not start containers at boot without a service manager, and a system unit installed by root would not run the rootless container under the user's own manager.
Question 4 of 10, Services and User Management
A service account named etlsvc must exist for running a daemon but must never be used for interactive logins and needs no home directory. Which command creates it appropriately?
- Auseradd -m -s /bin/bash etlsvc
- Badduser --disabled-password etlsvc
- Cuseradd -r -M -s /sbin/nologin etlsvc Correct answer
- Duseradd -G wheel -s /bin/false -m etlsvc
Answer and explanation: -r creates a system account with a UID from the system range, -M skips the home directory, and /sbin/nologin refuses interactive logins. The first command creates a normal interactive account, adduser --disabled-password on Debian still creates a home directory and a login shell, and adding the account to wheel grants sudo rights a service account should not have.
Question 5 of 10, Security
Only the management subnet 10.10.5.0/24 should be able to reach SSH on a server running firewalld, while web traffic stays open to everyone. Which approach is MOST appropriate?
- ASet the public zone's target to DROP and add http and https as services
- BBind the subnet as a source of a zone allowing ssh; remove ssh from public Correct answer
- CAdd a direct iptables rule with iptables -I INPUT that drops SSH from all addresses
- DChange sshd to listen on port 2222 and leave the public zone with its default services
Answer and explanation: Binding the management subnet as a source to a zone such as internal that permits ssh, while the public zone allows only web services, limits SSH to that subnet. A raw iptables rule bypasses firewalld and blocks SSH entirely, changing the port is obscurity rather than restriction, and a DROP target on public still leaves SSH unreachable for the management subnet unless another zone admits it.
Question 6 of 10, Security. Choose 2.
A hardened server must not load kernel modules that are not signed and must reject unsigned kernels at boot. Which combination provides this protection? (Choose two.)
- AEnable UEFI Secure Boot in the firmware Correct answer
- BEnable SELinux in permissive mode
- CBoot only the vendor-signed shim, GRUB, and kernel packages Correct answer
- DSet kernel.modules_disabled=1 in /etc/sysctl.d
- EInstall AIDE and verify /lib/modules daily
Answer and explanation: Secure Boot makes the firmware verify the signed shim, which verifies GRUB and the kernel, and a Secure Boot kernel then enforces module signatures, so signed vendor boot components are required for the chain to work. modules_disabled blocks all later module loading but never checks kernel signatures, permissive SELinux enforces nothing, and AIDE detects changed module files after the fact rather than preventing loading.
Question 7 of 10, Automation, Orchestration, and Scripting
Two engineers edited the same lines of roles/web/tasks/main.yml on different branches, and git merge reports a conflict. What is the correct way to complete the merge?
- ARun git commit --amend to replace the merge with the most recent commit
- BRun git merge --continue immediately so Git selects the newest change
- CEdit the file to resolve the conflict markers, git add it, then commit Correct answer
- DRun git pull --rebase to discard the other branch's edits
Answer and explanation: Git leaves conflict markers in the file; the engineer resolves them, stages the file to mark it resolved, and commits to finish the merge. merge --continue refuses to proceed while conflicts are unresolved, --amend rewrites the previous commit instead of completing the merge, and pull --rebase replays local commits rather than discarding anyone's edits.
Question 8 of 10, Automation, Orchestration, and Scripting
A team needs to reproduce a Python environment on another server with the same package versions. Which pair of commands does this?
- Apip freeze to a file, then pip install -r that file Correct answer
- Bpip download, then pip uninstall -r requirements.txt
- Cpython3 -m venv --copies, then python3 -m pip check
- Dpip list --outdated, then pip install --upgrade
Answer and explanation: pip freeze records exact versions of installed packages and pip install -r installs those versions elsewhere, ideally into a fresh virtual environment. Listing outdated packages and upgrading changes versions, venv with pip check only creates an environment and verifies dependencies, and uninstall removes packages rather than reproducing them.
Question 9 of 10, Troubleshooting
After an administrator deleted a 30 GB log file, df still shows /var as 98% full while du reports much less usage. What is the MOST likely cause and fix?
- AThe deletion is pending; run sync and wait for the next fsck
- BThe file was a hard link; delete the remaining link found with find -samefile
- CThe journal reserves space; run journalctl --vacuum-size=100M
- DA process still holds the deleted file open; find it with lsof +L1 Correct answer
Answer and explanation: Space is freed only when the last open file descriptor closes, so a daemon writing to the deleted log keeps the blocks allocated; lsof +L1 lists deleted-but-open files and restarting or signalling the process releases them. Journal vacuuming affects only journal files, sync does not free unlinked blocks held by open descriptors, and with a remaining hard link du would still count the data.
Question 10 of 10, Troubleshooting
A server boots, but the root file system is mounted read-only and the system enters emergency mode with 'Failed to start File System Check on /dev/mapper/rhel-root'. What is the BEST next step from the emergency shell?
- ARun dracut -f to rebuild the initramfs
- BDisable SELinux in /etc/selinux/config
- CRepair the root XFS file system with xfs_repair Correct answer
- DReinstall GRUB to the boot disk
Answer and explanation: The file system check failed, so the root file system must be repaired with the tool for its type, xfs_repair for the default RHEL XFS root, run while it is unmounted, for example from rescue media. GRUB and the initramfs already worked because the kernel found the root device, and SELinux is unrelated to a failed file system check.