Courseiva
hardMultiple Select

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 block execution; the execute bit on the file (or a parent directory's traverse bit) does. It tempts because ownership governs chmod and chown rights, so it matters when a script must be modified or deleted by a specific account rather than merely run.

  • ✗

    The user's umask is set to 022

    Why it's wrong here

    A umask of 022 only strips group and other write permission on newly created files; it leaves execute bits untouched, so it cannot prevent a script from running. It is tempting because umask does govern default permissions, and would be relevant if the question asked why new files lack write access.

  • ✓

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

    Why this is correct

    Without execute permission, the kernel denies execution regardless of read access, so the script cannot run. This directly satisfies the stem's execution-failure scenario: the user's effective permission bits on the file lack the x flag, blocking the execve call before any interpreter reads the contents.

  • ✓

    The filesystem containing the script is mounted with the noexec option

    Why this is correct

    Mounting with `noexec` blocks execution of any binary or script on that filesystem, regardless of the file's own permission bits. This directly satisfies the stem's scenario: the script sits in a home directory on a filesystem where execution is prohibited at mount level, so the kernel refuses to run it.

  • ✗

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

    Why it's wrong here

    /etc/shells lists valid login shells for services such as FTP and chsh; it does not restrict script execution, since the kernel honours the shebang path directly. It is tempting because shell validity matters for account login, but a script runs under any interpreter the user can execute.

About these practice questions

Courseiva writes every XK0-006 question from scratch — 781 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.