Question 429 of 507
How to Set Up a Shared Directory with SGID and ACL for Group Inheritance
An administrator needs to set up a shared directory /project for the group 'projectteam' (GID 5000). All members of the group should be able to create and delete files, but only the file owner can modify their own files. The directory should also ensure that new files inherit the group ownership. Which set of commands achieves this?
Quick Answer
The correct answer is the command sequence `chown root:projectteam /project; chmod 2770 /project; setfacl -d -m o::---` because it establishes a shared directory with group inheritance and file ownership restrictions by combining the SGID bit with a default ACL. The SGID bit (represented by the 2 in 2770) ensures that any new files or subdirectories automatically inherit the group `projectteam`, while the 770 permissions grant full read, write, and execute access to the group but deny others. The default ACL `setfacl -d -m o::---` then strips all permissions for "other" users on newly created files, which enforces that only the file owner can modify their own files—group members can create and delete files but cannot edit each other’s work. On the LFCS exam, this scenario tests your understanding of how SGID and ACLs work together to solve real-world multi-user collaboration requirements; a common trap is forgetting that `chmod 2770` alone does not prevent group members from modifying each other’s files. Memory tip: think "SGID for group stickiness, default ACL for ownership lockiness."
⚠ Common exam trap
Candidates often confuse directory write permission with file write permission. Directory write allows creating and deleting files; file write is required to modify content. The SGID bit ensures group inheritance, but file permissions depend on umask. Many think they need to explicitly restrict group write via ACL, but the default umask often achieves this.
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
✓
chown root:projectteam /project; chmod 2770 /project; setfacl -d -m o::--- /project
Option B correctly achieves all requirements. 'chown root:projectteam /project' sets the owner and group. 'chmod 2770 /project' sets the SGID bit (2) so new files inherit the group 'projectteam', and gives the owner and group full rwx on the directory (allowing group members to create and delete files), while granting no permissions to others. 'setfacl -d -m o::---' adds a default ACL that denies all access to others for new items. Since no default group ACL is defined, new files inherit group permissions from the process umask (typically 022, giving group read-only). Thus, group members have read-only access to files owned by others, so only the file owner can modify their files. All requirements are met without unnecessary ACLs for the group.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
chown root:projectteam /project; chmod 2775 /project; setfacl -m g:projectteam:rwx /project
Why it's wrong here
Default ACL not set, so new files may not inherit group permissions.
- ✓
chown root:projectteam /project; chmod 2770 /project; setfacl -d -m o::--- /project
Why this is correct
SGID (2) inherits group; 770 gives group rwx; default ACL denies others.
- ✗
chown root:projectteam /project; chmod 2775 /project
Why it's wrong here
Sticky bit (1) prevents deletion of others' files, which is not desired.
- ✗
chown root:projectteam /project; chmod 1770 /project; setfacl -m m::rwx /project
Why it's wrong here
Sticky bit (1) prevents deletion; mask not inherited.
Visual reference
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 →
Same concept, more angles
1 more way this is tested on LFCS
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 system administrator needs to ensure that all users in the 'developers' group have read and write access to a shared project directory /project/data, but new files created in that directory should belong to the 'developers' group automatically. Which command sequence achieves this goal?
medium- A.setfacl -m g:developers:rwx /project/data && chmod 2775 /project/data
- B.chown root:developers /project/data && chmod u+s /project/data
- C.chmod g+s /project/data && chown root:developers /project/data
- ✓ D.chown :developers /project/data && chmod g+s /project/data
Why D: `chown :developers /project/data` changes the group ownership of the directory to 'developers', and `chmod g+s /project/data` sets the setgid bit on the directory. The setgid bit ensures that new files created inside inherit the directory's group ('developers') instead of the creator's primary group, and the group ownership gives all members of 'developers' read and write access based on the directory's permissions (e.g., 775).
Last reviewed: Jun 30, 2026
This LFCS practice question is part of Courseiva's free Linux Foundation 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 LFCS exam.
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.
Sign in to join the discussion.