Question 68 of 510
TroubleshootingeasyMultiple SelectObjective-mapped

Quick Answer

The answer is the directory’s missing execute permission and an incorrect SELinux context. Even when a script file has proper execute permissions, the user must also have execute (often called the search) permission on the directory containing that script; without it, the kernel blocks traversal into the directory, denying access to any file inside regardless of its own permissions. On the CompTIA Linux+ XK0-005 exam, this question tests your understanding that file permissions alone are not enough—directory permissions and SELinux contexts both gate script execution. A common trap is checking only the script’s permissions while overlooking the directory’s execute bit or forgetting that SELinux contexts (like `httpd_sys_script_exec_t`) can override standard Unix permissions. Remember the mnemonic: “File says yes, but directory says no—and SELinux says maybe.”

XK0-005 Troubleshooting Practice Question

This XK0-005 practice question tests your understanding of troubleshooting. The scenario asks you to isolate a root cause — eliminate options that address a different problem before choosing. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

A technician is troubleshooting a user's inability to execute a script. The script has execute permissions for the user. Which of the following could be causing the issue? (Choose two.)

Question 1easymulti select
Full question →

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 is in a directory without execute permission

Option D is correct because even if the script file itself has execute permissions, the user must also have execute permission on the directory containing the script. The directory's execute bit (often called the 'search' bit) is required to traverse the directory and access files within it. Without it, the kernel will deny access to any file in that directory, regardless of the file's own permissions.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

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 is not the owner

    Why it's wrong here

    Ownership does not affect execution if permissions allow.

  • The script has a syntax error

    Why it's wrong here

    Syntax error causes runtime failure, not inability to execute.

  • The script is being blocked by a firewall

    Why it's wrong here

    Firewall does not affect local script execution.

  • The script is in a directory without execute permission

    Why this is correct

    Directories need execute permission for users to traverse.

    Related concept

    Read the scenario before looking for a memorised answer.

  • The script's SELinux context is incorrect

    Why this is correct

    SELinux can deny execution even if file permissions allow.

    Related concept

    Read the scenario before looking for a memorised answer.

Common exam traps

Common exam trap: answer the scenario, not the keyword

The trap here is that candidates focus solely on the file's execute permission and overlook the directory's execute permission, or they confuse SELinux context errors with simple permission issues.

Detailed technical explanation

How to think about this question

The directory execute permission is checked by the kernel's path resolution logic (via the `namei` function) before any file metadata is examined. In SELinux, the script's context (e.g., `unconfined_u:object_r:user_home_t:s0`) must be allowed by the domain transition rules; if the context is incorrect, the kernel's LSM (Linux Security Module) will deny execution even if DAC permissions are correct. A common real-world scenario is when a script is placed in a mounted filesystem with the `noexec` option, which also prevents execution regardless of permissions.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A security administrator must allow nursing staff to reach a patient records server while blocking access from the guest Wi-Fi VLAN. After applying an extended ACL, traffic is still blocked from nursing workstations. The ACL was applied outbound instead of inbound on the wrong interface. Questions like this test ACL direction and placement rules.

What to study next

Got this wrong? Here's your next step.

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Related practice questions

Related XK0-005 practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free XK0-005 practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this XK0-005 question test?

Troubleshooting — This question tests Troubleshooting — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: The script is in a directory without execute permission — Option D is correct because even if the script file itself has execute permissions, the user must also have execute permission on the directory containing the script. The directory's execute bit (often called the 'search' bit) is required to traverse the directory and access files within it. Without it, the kernel will deny access to any file in that directory, regardless of the file's own permissions.

What should I do if I get this XK0-005 question wrong?

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

1 more ways this is tested on XK0-005

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. Refer to the exhibit. A user wants to execute the script 'script.sh' but receives a 'Permission denied' error. Which action should be taken to allow execution?

easy
  • A.Add execute permission with chmod +x script.sh
  • B.Change the owner to the user with chown
  • C.Change the group to the user's primary group
  • D.Set the permissions to 644 with chmod

Why A: The 'Permission denied' error indicates the script lacks the execute permission for the user. The `chmod +x script.sh` command adds the execute permission bit to the file's mode, allowing the user to run it as a program. This is the direct and correct fix for the issue.

Last reviewed: Jun 25, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This XK0-005 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-005 exam.