All users can create files in a shared directory.
Prevent ordinary users from deleting or renaming files owned by others.
Which special mode should be added?
The sticky bit on a writable directory restricts deletion and renaming to the file owner, directory owner, or a privileged process.
Detailed explanation
Correct. The sticky bit enforces restricted deletion in a shared writable directory.
Incorrect. setuid affects effective user identity.
Incorrect. setgid controls group inheritance.
Incorrect. A read-only bit is not the standard special mode for this rule.
Try it yourself
An example you can run in a temporary verification environment.
tmp=$(mktemp -d); chmod 1777 "$tmp"; stat -c '%A %a' "$tmp"; chmod 700 "$tmp"; rmdir "$tmp"Expected result
drwxrwxrwt 1777Key points
- Sticky bit
- The t position
- Common example is /tmp
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
The sticky bit changes who may remove or rename entries; it does not make a directory read-only.
Check the side effect
Consider directory write and execute permissions separately from the sticky-bit restriction.