Courseiva
SecuritymediumMultiple ChoiceObjective-mapped

XK0-006 Security Practice Question

A security audit reveals that the /etc/shadow file is readable by all users. What is the most appropriate immediate action?

⚠ Common exam trap

The XK0-005 exam often tests the misconception that simply setting restrictive permissions (like 600) is sufficient, without also ensuring the correct group ownership (shadow), which is a common oversight in Linux security hardening.

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 && chown root:shadow /etc/shadow

The /etc/shadow file stores hashed user passwords and must be protected from unauthorized access. The correct command is `chmod 600 /etc/shadow && chown root:shadow /etc/shadow` because it sets the file to be readable and writable only by the owner (root) and changes the group to 'shadow', which is the standard group used by many Linux distributions to allow certain system utilities (like `pwck` or `unix_chkpwd`) to read the file without granting access to all users. This ensures that only root and members of the shadow group can read the file, immediately fixing the security issue.

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 000 /etc/shadow

    Why it's wrong here

    Removes all permissions, including root's, preventing login.

  • chmod 600 /etc/shadow && chown root:shadow /etc/shadow

    Why this is correct

    Sets proper permissions and ownership to root and shadow group.

  • chmod 640 /etc/shadow

    Why it's wrong here

    Allows group read access; should be restricted to root.

  • chmod 600 /etc/shadow

    Why it's wrong here

    Only root can read/write; correct, but not most appropriate yet.

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.