Courseiva
GNU and Unix Commands →hardMultiple Choice

LPIC-1 GNU and Unix Commands Practice Question

A Linux administrator needs to change the permissions of a directory named /shared so that only the owner can read, write, and execute, while group members can read and execute but not write, and others have no access. The administrator also wants any new files created inside /shared to inherit the group ownership of /shared. Which command sequence will achieve this?

⚠ Common exam trap

Watch out — candidates often confuse setuid and setgid on directories; setuid is ignored on directories, while setgid is used for group inheritance.

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 750 /shared && chmod g+s /shared

Setting permissions to 750 restricts access appropriately: owner rwx, group rx, others none. The setgid bit on a directory ensures that new files and subdirectories inherit the directory's group ownership, which is essential for shared collaborative spaces. The combination of chmod 750 and chmod g+s achieves both the permission and group inheritance goals.

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 750 /shared && chmod u+s /shared

    Why it's wrong here

    The chmod 750 correctly sets the permissions, but chmod u+s sets the setuid bit on the directory, which is ignored on Linux for directories. The requirement is to inherit group ownership, which requires setgid, not setuid. This command sequence fails to achieve the desired group inheritance.

  • ✗

    chmod 755 /shared && chmod g+s /shared

    Why it's wrong here

    The chmod 755 gives read and execute permissions to others, which violates the requirement that others have no access. Although the setgid bit is correctly applied, the overly permissive mode allows unintended access. This does not satisfy the security constraint specified.

  • ✓

    chmod 750 /shared && chmod g+s /shared

    Why this is correct

    The chmod 750 sets permissions to rwxr-x---, giving the owner full control, group read and execute, and no access to others. The chmod g+s sets the setgid bit on the directory, causing new files and subdirectories to inherit the group ownership of /shared. This combination meets both requirements.

  • ✗

    chmod 640 /shared && chmod g+s /shared

    Why it's wrong here

    The chmod 640 removes execute permissions for the owner and group, making it impossible to enter the directory or execute files within it. Directories require execute permission to be traversed. Although setgid is set, the base permissions are incorrect for a directory that needs to be accessible.

About these practice questions

Courseiva writes every LPIC-1 question from scratch — 402 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 LPI exam blueprint

This LPIC-1 practice question is part of Courseiva's free LPI 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 LPIC-1 exam.