The team directory is owned by group developers.
Make new files inherit developers instead of the creator's primary group.
Which special mode should be set?
Directory SGID causes new entries to inherit the parent directory's group, helping keep collaborative files aligned.
Detailed explanation
Incorrect. setuid changes effective user identity for executables.
Incorrect. The sticky bit restricts deletion in shared directories.
Correct. setgid on the directory provides group inheritance.
Incorrect. Combining unrelated bits is unnecessary for group inheritance.
Try it yourself
An example you can run in a temporary verification environment.
tmp=$(mktemp -d); chmod g+s "$tmp"; stat -c '%A %a' "$tmp"; chmod 700 "$tmp"; rmdir "$tmp"Expected result
グループ実行位置にsを含む表示と、2で始まる4桁モードKey points
- Directory SGID
- Group inheritance
- Group write is separate
Notes
- Environment: GNU coreutils 9.x / 一時ディレクトリ
- Use a disposable file or directory when checking chmod calculations.
- Exact permission display can vary slightly with filesystem and distribution defaults.
Foundation review
Place the operation
SGID helps keep a shared directory's group ownership consistent, while group write permission still controls editing.
Check the side effect
Check both SGID and the resulting rwx permissions; inheritance alone does not grant write access.