LFCS · Question #755
The sticky bit is usually set on
The correct answer is B. /tmp. The sticky bit is typically set on the /tmp directory to prevent users from deleting or renaming files they do not own, even if the directory is world-writable.
Question
Options
- A/var/log
- B/tmp
- C/home
- Dlog files
How the community answered
(27 responses)- A7% (2)
- B89% (24)
- D4% (1)
Why each option
The sticky bit is typically set on the `/tmp` directory to prevent users from deleting or renaming files they do not own, even if the directory is world-writable.
/var/log contains system logs, typically managed by root or specific services, and does not commonly require a sticky bit.
The sticky bit, when set on a directory like `/tmp`, prevents users from deleting or renaming files within that directory unless they own the file, own the directory, or are the root user. This is critical for `/tmp` as it is a world-writable directory where multiple users might create temporary files, ensuring other users cannot maliciously remove them.
/home directories are owned by individual users, and a sticky bit on `/home` itself would be overly restrictive and not a standard configuration.
Log files themselves do not usually have the sticky bit; the permissions are typically set on the directory containing them or directly on the file to control write access.
Concept tested: Sticky bit on directories
Source: https://man7.org/linux/man-pages/man7/file-permissions.7.html
Topics
Community Discussion
No community discussion yet for this question.