Courseiva
System Management →hardMultiple Choice

XK0-006 System Management Practice Question

An administrator needs to apply a set of permissions to an existing directory and all its contents, setting the owner to 'rwx', group to 'rx', and others to '---'. Additionally, newly created files within the directory should inherit the group. Which commands should the administrator run? (Assume the directory is /data, and the group is 'staff'.)

⚠ Common exam trap

XK0-006 often tests the difference between recursive and non-recursive chmod, and the effect of the setgid bit on directories, leading candidates to forget the -R flag or the setgid command.

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 -R 750 /data; chmod g+s /data

The command 'chmod -R 750 /data' recursively sets permissions for the directory and all its contents to owner rwx, group rx, and others none. The command 'chmod g+s /data' sets the setgid bit on the directory, ensuring that newly created files and subdirectories inherit the group ownership of the directory (staff). Together, these commands meet the requirements.

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 -R 750 /data; chmod g+s /data

    Why this is correct

    The recursive 750 sets owner rwx, group rx and no others permissions across /data and its contents, while the setgid bit forces new files to inherit the staff group rather than the creator's primary group, meeting the inheritance constraint.

  • ✗

    chmod 750 /data; chmod g+s /data

    Why it's wrong here

    Omitting -R leaves existing contents untouched, so only /data itself gains 750; the stem requires the permissions applied recursively. The setgid bit is genuinely needed for group inheritance, making this option tempting, but it must accompany a recursive chmod rather than a single-directory one.

  • ✗

    chmod -R 755 /data; chmod g+s /data

    Why it's wrong here

    chmod -R 755 sets owner rwx, group rx and others rx, leaving others with read and execute instead of the required ---. It is tempting because the recursive flag and setgid bit are needed, but the numeric mode must be 750 to remove all others permissions.

  • ✗

    chmod -R 750 /data

    Why it's wrong here

    chmod -R 750 sets the permission bits correctly but does nothing about inheritance, so new files will not adopt the 'staff' group. Setting the setgid bit (chmod g+s) on /data is what makes newly created entries inherit the directory's group.

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 and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official CompTIA exam blueprint

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.