Advanced Topics | Sticky Bit#
What is a Sticky Bit?#
A sticky bit is a special permission flag in Unix-like operating systems that can be set on files or directories. When applied to a directory, the sticky bit restricts the deletion or renaming of files within that directory to the file's owner, the directory's owner, or the root user. This means that even if other users have write permissions to the directory, they cannot delete or rename files they do not own.
While the sticky bit can technically be set on files, this usage is rare and primarily of historical significance in modern systems. On directories, however, it plays an essential role in preventing accidental or unauthorized deletion of files, especially in shared environments.
How are Sticky Bits Used on Oak?#
On Oak, the sticky bit is automatically applied to the root directory of each storage space. This is particularly useful in shared environments, as it prevents accidental deletions and ensures that only the file owner or the directory owner can delete or rename objects at the base level, even if other users have write access.
This feature has saved many groups from unintentional data loss. For example, it protects against scenarios where a well-meaning team member performs a recursive operation that could otherwise modify or delete large amounts of data they do not own but have permission to write.
Additional Support#
If you do not want the sticky bit enabled on your Oak space, you can request to have it disabled by emailing srcc-support@stanford.edu. We are happy to assist with any questions or adjustments.