nerdexam
CompTIA

XK0-005 · Question #722

A Linux administrator wants a permission bit on a shared folder that allows only the owner of the file within that directory or the root user to delete or rename the file. Which of the following…

The correct answer is C. chmod o+t /directory/. The t bit, also known as the sticky bit, is used in shared directories to control file deletion. When the sticky bit is set on a directory: Only the owner of the file, the owner of the directory, or the root user can delete or rename files within that directory. Other users…

System Management

Question

A Linux administrator wants a permission bit on a shared folder that allows only the owner of the file within that directory or the root user to delete or rename the file. Which of the following commands will help achieve this goal?

Options

  • Achmod u+w /directory/
  • Bchmod a+r /directory/
  • Cchmod o+t /directory/
  • Dchmod g+s /directory/

How the community answered

(30 responses)
  • A
    17% (5)
  • B
    7% (2)
  • C
    73% (22)
  • D
    3% (1)

Explanation

The t bit, also known as the sticky bit, is used in shared directories to control file deletion. When the sticky bit is set on a directory: Only the owner of the file, the owner of the directory, or the root user can delete or rename files within that directory. Other users, even if they have write permissions to the directory, cannot delete or rename files that they do not own. The command chmod o+t /directory/ sets the sticky bit on the directory, achieving the desired behavior for a shared folder where only the owner of the files or the root user can delete

Topics

#Linux Permissions#Sticky Bit#chmod#Directory Permissions

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice