Question 471 of 510
SecurityeasyMultiple ChoiceObjective-mapped

Quick Answer

The correct command is `chmod 600 /etc/shadow`, which sets read and write permissions exclusively for the root owner while stripping all access from group and others. This is essential because the /etc/shadow file stores hashed user passwords, and permissions 777 would allow any user on the system to read, modify, or even execute the file, creating a critical security vulnerability that exposes password hashes to brute-force attacks. On the CompTIA Linux+ XK0-005 exam, this scenario tests your understanding of Linux file permissions and the principle of least privilege, often appearing as a straightforward fix for a security audit finding. A common trap is confusing this with `chmod 644`, which would still allow group or others to read the file—remember, shadow must be root-only. A useful memory tip: think of "600" as "six-zero-zero" meaning "only the owner (root) gets the key (read/write), and everyone else gets zero access."

XK0-005 Security Practice Question

This XK0-005 practice question tests your understanding of security. Match the stated requirement to the specific cloud service, access model, or configuration option — many options are valid in isolation but not for this scenario. 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 security audit reveals that the /etc/shadow file has permissions 777. Which command should be used to correct this vulnerability?

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 1easymultiple 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

chmod 600 /etc/shadow

The /etc/shadow file stores hashed user passwords and must be readable only by root to prevent unauthorized access. Permissions 777 allow any user to read, write, and execute the file, which is a critical security vulnerability. The correct command is `chmod 600 /etc/shadow`, which sets read and write permissions for the owner (root) only, denying all access to group and others.

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.

  • chmod 660 /etc/shadow

    Why it's wrong here

    Allows group write, which is insecure.

  • chmod 600 /etc/shadow

    Why this is correct

    Only root can read/write.

    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.

  • chmod 644 /etc/shadow

    Why it's wrong here

    Allows world read, which is insecure.

  • chmod 640 /etc/shadow

    Why it's wrong here

    Allows group read, which is insecure.

Common exam traps

Common exam trap: answer the scenario, not the keyword

The trap here is that candidates often confuse the required permissions for /etc/shadow with those for /etc/passwd (which is 644), leading them to choose 644 or 640 instead of the more restrictive 600.

Detailed technical explanation

How to think about this question

The /etc/shadow file is owned by root and typically has group 'shadow' on many Linux distributions, but the standard secure permission is 600 (or 640 only if specific daemons like unix_chkpwd need group read). The execute bit on a regular file is meaningless here, but 777 would allow any user to execute the file as a script, potentially leading to privilege escalation if the file contains executable content. In practice, many security benchmarks (e.g., CIS) mandate 600 for /etc/shadow.

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?

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

What is the correct answer to this question?

The correct answer is: chmod 600 /etc/shadow — The /etc/shadow file stores hashed user passwords and must be readable only by root to prevent unauthorized access. Permissions 777 allow any user to read, write, and execute the file, which is a critical security vulnerability. The correct command is `chmod 600 /etc/shadow`, which sets read and write permissions for the owner (root) only, denying all access to group and others.

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. A security audit reveals that a server's /etc/shadow file is readable by all users. Which command would correctly fix the permissions?

hard
  • A.chmod 644 /etc/shadow
  • B.chmod 600 /etc/shadow
  • C.chmod 640 /etc/shadow
  • D.chmod 640 /etc/shadow && chown root:shadow

Why B: Option A is correct because 'chmod 600 /etc/shadow' sets the file to be readable and writable only by the owner (root), which is the standard permission. Option B (640) allows group read access. Option C (644) allows world read. Option D includes a chown that is unnecessary.

Last reviewed: Jun 11, 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.