010-160 · Question #41
Given the following directory permissions: drwxrwxrwt 14 root root 36864 2012-03-02 11:17 /tmp What does the letter t at the end of drwxrwxrwt indicate?
The correct answer is B. It means that even though the directory is globally writable only the owner can delete their own files. The sticky bit (t) on a directory restricts file deletion so that only the file owner, directory owner, or root can remove or rename files, even in a world-writable directory.
Question
Options
- AIt is the sticky bit that causes all commands in this directory to be launched as root.
- BIt means that even though the directory is globally writable only the owner can delete their own files.
- CIt makes the directory accessible for everybody.
- DIt indicates that this directory contains only temporary files that may be deleted.
- EIt is removed by the system after a specified time.
How the community answered
(67 responses)- B90% (60)
- C6% (4)
- D1% (1)
- E3% (2)
Why each option
The sticky bit (t) on a directory restricts file deletion so that only the file owner, directory owner, or root can remove or rename files, even in a world-writable directory.
Running commands as root is associated with the setuid bit on executables, not the sticky bit on directories.
The sticky bit set on a directory means that despite world-write permissions, only the owner of a specific file, the directory owner, or root may delete or rename that file. This is the standard protection on /tmp, preventing users from deleting each other's temporary files in a shared, world-writable space.
Directory accessibility for all users is granted by the rwx permission bits already present; the sticky bit does not control who can enter the directory.
The sticky bit is a permission flag with no relationship to the type, content, or permanence of files stored inside the directory.
The sticky bit is a static permission setting and is never automatically removed by the system after any time period.
Concept tested: Linux sticky bit effect on world-writable directories
Source: https://man7.org/linux/man-pages/man1/chmod.1.html
Topics
Community Discussion
No community discussion yet for this question.