nerdexam
LPI

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.

Security and File Permissions

Question

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?

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)
  • B
    90% (60)
  • C
    6% (4)
  • D
    1% (1)
  • E
    3% (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.

AIt is the sticky bit that causes all commands in this directory to be launched as root.

Running commands as root is associated with the setuid bit on executables, not the sticky bit on directories.

BIt means that even though the directory is globally writable only the owner can delete their own files.Correct

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.

CIt makes the directory accessible for everybody.

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.

DIt indicates that this directory contains only temporary files that may be deleted.

The sticky bit is a permission flag with no relationship to the type, content, or permanence of files stored inside the directory.

EIt is removed by the system after a specified time.

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

#sticky bit#directory permissions#file ownership#/tmp

Community Discussion

No community discussion yet for this question.

Full 010-160 Practice