Question 46 of 510
TroubleshootingmediumMultiple ChoiceObjective-mapped

Quick Answer

The answer is the `namei -l /path/to/service` command, because a "permission denied" error on service startup under a non-root user often stems not from the binary itself but from missing execute permissions on any parent directory in the path. The `namei -l` command recursively lists the permissions of every component—from root down to the file—so you can instantly spot a directory that lacks the search bit for the service user, which blocks access even if the binary is correctly set. On the CompTIA Linux+ XK0-005 exam, this question tests your understanding that Linux path resolution requires execute permission on each directory, a common trap where students check only the file’s permissions. A useful memory tip: think of `namei` as "name inspector" that walks the entire directory tree, ensuring no "locked gate" blocks the service user’s path.

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 user reports that a service fails to start with the error 'Permission denied'. The service runs under a non-root user. Which command should the administrator use to check if the service has the correct file permissions?

Clue words in this question

Noticing these words before you look at the options changes how you read each choice.

  • Clue: "which command"

    Why it matters: Tests specific CLI syntax. Recall the exact command and its required context — near-synonyms and partial matches are common distractors.

Question 1mediummultiple choice
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

namei -l /path/to/service

The error 'Permission denied' when starting a service under a non-root user often involves not just the file's own permissions but also the permissions of each directory in the path leading to the service binary. The `namei -l` command recursively lists the permissions of every component in the path, revealing if any parent directory lacks execute (search) permission for the service user, which would block access even if the binary itself is correctly set. This makes it the most comprehensive tool for diagnosing path-based permission issues.

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.

  • namei -l /path/to/service

    Why this is correct

    namei -l walks the entire path and shows permissions for each component, revealing any 'Permission denied' at intermediate steps.

    Clue confirmation

    The clue word "which command" in the question point toward this answer.

    Related concept

    Read the scenario before looking for a memorised answer.

  • ls -l /path/to/service

    Why it's wrong here

    ls -l shows permissions of the final file, not intermediate directories or symlinks.

  • getfacl /path/to/service

    Why it's wrong here

    getfacl shows ACL entries, but if the issue is basic permissions on a directory in the path, it may not show the problem.

  • stat /path/to/service

    Why it's wrong here

    stat provides details but does not decompose the path; it only shows the final file's inode.

Common exam traps

Common exam trap: answer the scenario, not the keyword

The trap here is that candidates assume `ls -l` or `stat` on the service binary alone is sufficient, overlooking that the 'Permission denied' error often originates from a missing execute bit on a parent directory in the path, which only `namei -l` can reveal by checking every component.

Trap categories for this question

  • Command / output trap

    ls -l shows permissions of the final file, not intermediate directories or symlinks.

Detailed technical explanation

How to think about this question

Under the hood, the Linux VFS performs a path walk for every file access, checking execute permission on each directory component (the 'x' bit) before reaching the target inode. If any directory in the path lacks the execute bit for the user or group, the kernel returns EACCES ('Permission denied') immediately, even if the final file has 777 permissions. The `namei` command uses the `stat()` system call on each path component sequentially, mimicking the kernel's path resolution, which is why it's the correct diagnostic tool for this scenario.

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 small business has 20 workstations on the 192.168.1.0/24 network and one public IP from its ISP. The router uses PAT (NAT overload) so all 20 devices share one public address using different source ports. NAT questions test whether you understand the four address terms and which direction each translation applies.

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: namei -l /path/to/service — The error 'Permission denied' when starting a service under a non-root user often involves not just the file's own permissions but also the permissions of each directory in the path leading to the service binary. The `namei -l` command recursively lists the permissions of every component in the path, revealing if any parent directory lacks execute (search) permission for the service user, which would block access even if the binary itself is correctly set. This makes it the most comprehensive tool for diagnosing path-based permission issues.

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.

Are there clue words in this question I should notice?

Yes — watch for: "which command". Tests specific CLI syntax. Recall the exact command and its required context — near-synonyms and partial matches are common distractors.

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. Given the journalctl output for the httpd service, which of the following is the most likely cause?

hard
  • A.The /var/www directory is missing the execute (x) permission for the Apache user
  • B.The file /var/www/html/index.html has incorrect SELinux context
  • C.The Apache service is running under the wrong user
  • D.The file /var/www/html/index.html is missing read permission for the Apache user

Why A: The error explicitly states missing search permissions on a component of the path, which typically means a directory in the path lacks execute permission. The most common cause is the /var/www directory lacking execute permission for the Apache user.

Keep practising

More XK0-005 practice questions

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.