RHEL Linux - Red Hat System Administration Practice Exam

Disable ads (and more) with a membership for a one time $4.99 payment

Study for the RHEL Linux - Red Hat System Administration Exam. Enhance your knowledge with flashcards and multiple-choice questions, complete with hints and explanations. Prepare for your certification!

Practice this question and more.


What is the effect of setting the sticky bit on a directory?

  1. Only the owner can delete their files in the directory

  2. Files within the directory cannot be executed

  3. All users can delete files within the directory

  4. Only root can delete any files within the directory

The correct answer is: Only the owner can delete their files in the directory

Setting the sticky bit on a directory primarily affects permissions, particularly in multi-user environments. When the sticky bit is set, it ensures that only the file's owner (the user who created the file) can delete or rename their files within that directory. This is particularly useful in shared directories, such as /tmp, where multiple users may have permissions to create files. With the sticky bit enabled, even if other users have write permissions to the directory, they cannot delete or rename files they do not own. This protects users' files from being accidentally or maliciously removed by other users, thus maintaining a level of privacy and security in shared environments. In contrast, if the sticky bit were not set, any user with write permissions could delete or rename any file in that directory regardless of ownership, which could lead to conflicts and loss of data. Therefore, setting the sticky bit offers an additional layer of control and safety in handling files within a shared directory context.