Courseiva
mediumMultiple ChoiceObjective-mapped

XK0-006 Practice Question: Based on the exhibit, why does the mv command…

Network Topology
-rw-rrRefer to the exhibit.$ getenforceEnforcing$ ls -Z /etc/shadow$ ls -Z /tmp/testfile$ sudo mv /tmp/testfile /etc/shadow

Based on the exhibit, why does the mv command fail?

⚠ Common exam trap

CompTIA often tests the distinction between DAC (standard Linux permissions) and MAC (SELinux) by presenting a scenario where root appears to have permission but the command still fails, leading candidates to overlook SELinux and incorrectly blame filesystem mount options or directory permissions.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

SELinux is preventing the move due to file context mismatch.

SELinux enforces mandatory access controls that can prevent file operations even when standard Linux permissions (DAC) allow them. When moving a file from one directory to another, SELinux checks the file context of the source and the target directory; if the context of the file does not match the expected type for the target directory (e.g., moving a file with `unconfined_u:object_r:user_home_t` into `/etc` which expects `etc_t`), the move is denied. The `mv` command fails with a 'Permission denied' error, and the denial is logged in `/var/log/audit/audit.log`.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • The user has exceeded the disk quota on the /etc partition.

    Why it's wrong here

    No quota error is shown.

  • The /etc filesystem is mounted read-only.

    Why it's wrong here

    No indication of read-only mount; the error is about inter-device move.

  • SELinux is preventing the move due to file context mismatch.

    Why this is correct

    SELinux enforcing mode and context mismatch cause denial.

  • The /etc directory does not have write permissions for root.

    Why it's wrong here

    Root typically has write access to /etc; the error is SELinux-related.

Quick reference

Access Control Model Comparison

ModelAcronymWho Controls Access?Best For
Discretionary Access ControlDACResource ownerSmall teams, file shares
Mandatory Access ControlMACSystem / security labelsClassified govt / military
Role-Based Access ControlRBACAdministrator (via roles)Enterprise environments
Attribute-Based Access ControlABACPolicy engine (user + resource attributes)Fine-grained, dynamic policies
Rule-Based Access ControlRuBACSystem rules / ACLsFirewall rules, network ACLs

About these practice questions

Courseiva writes every XK0-006 question from scratch — 979 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This XK0-006 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the XK0-006 exam.