-   Linux - Software (
-   -   Sticky-bit (

fakie_flip 11-17-2012 02:46 PM

If a directory has does not have write permission for both group and others, does setting sticky bit on it affect it at all? How?

frankbell 11-17-2012 08:24 PM

According to this link:


If you set the sticky bit to a directory, other users cannot delete or rename the files (or subdirectories) within that directory.

When the sticky bit is set on a directory, only the owner and the root user can delete / rename the files or directories within that directory.
It does not seem to affect permission to write a file to the directory, but I was too lazy to test for it.

fakie_flip 11-19-2012 12:25 PM

I know that much, but it only applies when users who are not the owner of the directory have write permissions. Otherwise, they wouldn't be able to modify anything under that directory anyways that they are not the owner of.

rknichols 11-19-2012 05:04 PM

The owner of the directory is always permitted to delete any file there, so the sticky bit would have no effect if the only write permission for the directory is for the directory owner. If either the "group" or the "other" write permission bit is set, then the sticky bit would prevent someone other than the directory owner from removing a file that they did not own.

All times are GMT -5. The time now is 01:16 PM.