nerdexam
LPI

010-150 · Question #42

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. The 't' character at the end of a permission string on a directory represents the sticky bit, which restricts file deletion to the file's owner even when the directory is world-writable.

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
  • CIt makes the directory accessible for everybody.
  • DIt indicates that this directory contains only temporary files that may be deleted.
  • EIt is a temporary bit that prevents launching commands in this directory.

How the community answered

(63 responses)
  • A
    6% (4)
  • B
    81% (51)
  • C
    8% (5)
  • D
    2% (1)
  • E
    3% (2)

Why each option

The 't' character at the end of a permission string on a directory represents the sticky bit, which restricts file deletion to the file's owner even when the directory is world-writable.

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

Executing files as root is the behavior of the setuid bit on an executable, not the sticky bit on a directory.

BIt means that even though the directory is globally writable only the owner can delete their ownCorrect

The sticky bit on a directory prevents users from deleting or renaming files they do not own, even if they have write permission on the directory itself. This is the classic use case on /tmp, where all users can create files but cannot delete files belonging to others. Only the file owner, the directory owner, or root can remove files in a sticky-bit directory.

CIt makes the directory accessible for everybody.

World accessibility is already granted by the 'rwx' bits for 'others'; the sticky bit adds a deletion restriction, not an access grant.

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

The sticky bit has no bearing on file content type or lifecycle; it is purely an access-control mechanism on deletion.

EIt is a temporary bit that prevents launching commands in this directory.

The sticky bit does not restrict command execution in the directory; it only restricts which users may delete or rename files within it.

Concept tested: Linux sticky bit on world-writable directories

Source: https://www.gnu.org/software/coreutils/manual/html_node/Directory-Setuid-and-Setgid.html

Topics

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

Community Discussion

No community discussion yet for this question.

Full 010-150 Practice