Sticky Bit !
HI Geeks !
Can anyone Guide me to learn Sticky bit Concepts ? I would like to know , What is sticky bit ? What is the purpose of sticky ? |
Historically, a program with the sticky bit set would remain resident in core memory.
Now it is used for directories. Since deleting files is an operation on the directory, rather than the file inside, anyone with write access to the directory would be able to delete files inside, even if they don't own those files. The sticky bit set on a directory prevents users from deleting the files owned by someone else. It tends to be used for /tmp and external world writable directories. |
I'd add more...
Sticky Bit is a permission bit that protects the files within a directory. If the directory has sticky bit set, a file inside it can be deleted by the owner of the file, the owner of the directory or root only. This prevents a user from deleting other users files from public directories. The sticky bit is displayed as a letter t in the execute field for 'others', when we list the directory using ls or ls -ld <dir_name>. If a directory is writable and has sticky bit is set, files within directory removed or renamed only if one or more following is true: > The user owns the file > The user owns the directory > The file writable by the user > The user is root To set it: Code:
user@example$ chmod 1755 /path/to/dir Code:
user@example$ ls -ld /path/to/dir |
I believe its the leading '1' that denotes sticky bit, 2=sgid, 4=suid
|
Stickybit is nothing but the owner of the file can only delete the file.
Regards, Kathirvel.S |
Quote:
Thanks guyz ! Thanks to all ! |
Quote:
Meanwhile, in many organizations, I have observed that people do not normally request for sticky bit for their large project data. But they prefer SGID. Although sticky bit and SGID have different functions, but ultimately both are used for "protection of data" from unauthorized users. |
All times are GMT -5. The time now is 04:50 PM. |