nerdexam
Linux_Foundation

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.

Submitted by anjalisingh· Apr 18, 2026User and Group Management

Question

The sticky bit is usually set on

Options

  • A/var/log
  • B/tmp
  • C/home
  • Dlog files

How the community answered

(27 responses)
  • A
    7% (2)
  • B
    89% (24)
  • D
    4% (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.

A/var/log

/var/log contains system logs, typically managed by root or specific services, and does not commonly require a sticky bit.

B/tmpCorrect

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.

C/home

/home directories are owned by individual users, and a sticky bit on `/home` itself would be overly restrictive and not a standard configuration.

Dlog files

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

#Sticky bit#File permissions#/tmp directory

Community Discussion

No community discussion yet for this question.

Full LFCS Practice