RHEL Linux - Red Hat System Administration Practice Exam

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

Question: 1 / 130

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

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.

Files within the directory cannot be executed

All users can delete files within the directory

Only root can delete any files within the directory

Next

Report this question