Courseiva
hardMultiple Select

XK0-006 Practice Question: Which TWO conditions must be met for a user to…

Which TWO conditions must be met for a user to successfully delete a file owned by a different user in a directory? (Choose two.)

⚠ Common exam trap

The trap here is that candidates mistakenly think file write permission (Option A) or file ownership (Option D) is required for deletion, when in fact directory permissions are the sole deciding factor for removing a directory entry.

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

✓

The user has write permission on the directory

To delete a file in Linux, the user does not need any permissions on the file itself; instead, the user needs write permission on the directory because deleting a file modifies the directory's contents (removing the directory entry). Additionally, execute permission on the directory is required to access the directory and its inode entries, allowing the user to traverse the directory to locate the file. These two permissions together enable the deletion of a file owned by another user.

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 write permission on the file

    Why it's wrong here

    Deletion depends on write and execute permission on the containing directory, not on the file itself; file write permission governs content modification. It tempts because write access feels necessary to remove data, but a user with directory write can unlink a read-only file they do not own.

  • ✓

    The user has write permission on the directory

    Why this is correct

    Deleting a file modifies the directory's entries, so the kernel checks directory write permission rather than file ownership. This satisfies the stem's requirement for removing another user's file, since the file's own permissions are irrelevant to unlink.

  • ✓

    The user has execute permission on the directory

    Why this is correct

    Traversal into the directory requires execute permission, allowing the kernel to resolve the filename to its inode before unlinking. Without it, the user cannot reach the entry even with write access, so this condition is mandatory.

  • ✗

    The user is the owner of the file

    Why it's wrong here

    Ownership of the file grants no deletion right; unlinking requires write and execute permission on the parent directory, plus the sticky-bit rule where set. It tempts because owners control their files, but a non-owner with directory write can delete another user's file unless the sticky bit prevents it.

  • ✗

    The user is a member of the group that owns the directory

    Why it's wrong here

    Group ownership of the directory grants write permission on the directory itself, which permits creating, renaming or removing entries only when the sticky bit is absent; with the sticky bit set, deletion still requires ownership of the file or root. It is tempting because directory write access normally governs entry removal.

About these practice questions

This XK0-006 question is part of Courseiva's 781-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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.