Bird
0
0

To ensure a shared directory /shared causes new files to inherit the directory's group and prevents users from deleting files they do not own, which special permissions should be set?

hard📝 Application Q8 of 15
Linux CLI - File Permissions and Ownership
To ensure a shared directory /shared causes new files to inherit the directory's group and prevents users from deleting files they do not own, which special permissions should be set?
ASet only the sticky bit on the directory
BSet the setuid bit on the directory and enable the sticky bit
CSet the setgid bit on the directory and enable the sticky bit
DSet only the setgid bit on the directory
Step-by-Step Solution
Solution:
  1. Step 1: Understand setgid on directories

    Setgid on a directory causes new files to inherit the directory's group ownership.
  2. Step 2: Understand sticky bit on directories

    The sticky bit restricts file deletion to the file owner or root.
  3. Step 3: Combine permissions

    Setting both setgid and sticky bit achieves the desired behavior.
  4. Final Answer:

    Set the setgid bit on the directory and enable the sticky bit -> Option C
  5. Quick Check:

    Setgid for group inheritance + sticky bit for deletion control [OK]
Quick Trick: Setgid + sticky bit for shared directory control [OK]
Common Mistakes:
MISTAKES
  • Using setuid instead of setgid on directories
  • Setting only sticky bit without setgid
  • Assuming setgid controls file deletion

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes