Courseiva
hardMultiple SelectObjective-mapped

XK0-006 Execute permission Practice Question

A system administrator is troubleshooting why a user cannot execute a script in their home directory. Which TWO conditions could prevent execution? (Choose two.)

⚠ Common exam trap

Common pitfalls include thinking that file ownership, umask, or the /etc/shells file prevent execution. In reality, the two key blockers are: absence of execute permission and the noexec mount option. Many candidates mistakenly believe that a shell must be listed in /etc/shells for script execution, but that file is only used for login shells.

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 script does not have the execute permission set for the user

For a user to execute a script, the file must have the execute permission bit set for that user (or for the group or others, depending on the user's relationship to the file). Without the execute permission (e.g., `chmod +x`), the shell will refuse to run the script directly, returning a 'Permission denied' error. Option D is correct because if the filesystem is mounted with the noexec option, no files on that filesystem can be executed, regardless of permissions. Option E is incorrect because /etc/shells is only used to validate login shells; it does not affect script execution. The interpreter for a script is determined by the shebang line, and the system will attempt to run it regardless of whether it's listed in /etc/shells. Options A and B are incorrect: file ownership does not directly prevent execution as long as the user has appropriate permissions, and umask only affects default permissions of newly created files, not existing ones.

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 script is owned by a different user

    Why it's wrong here

    Ownership alone does not prevent execution; the user may still have execute permission via group or other.

  • The user's umask is set to 022

    Why it's wrong here

    Umask affects default permissions of newly created files, not execution of existing files.

  • The script does not have the execute permission set for the user

    Why this is correct

    Without execute permission, the script cannot be run.

  • The filesystem containing the script is mounted with the noexec option

    Why this is correct

    The noexec mount option prevents execution of any binary or script on that filesystem.

  • The script is interpreted by a shell that is not listed in /etc/shells

    Why it's wrong here

    Incorrect. The /etc/shells file lists valid login shells but is not checked when executing a script; the script's interpreter is determined by the shebang line, and the system will attempt to run it regardless.

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.