1827286 Members
1618 Online
109717 Solutions
New Discussion

directory permission.

 
SOLVED
Go to solution
peterchu
Super Advisor

directory permission.

I have a directoy permission is with "t" , but I still remove the directory , what is the usage for permission "t" ? thx.


drwsrwsrwt 2 root root 4096 Aug 24 14:59 temp
4 REPLIES 4
Sunil Sharma_1
Honored Contributor
Solution

Re: directory permission.

Hi,

t stands for sticky bit. when sticky bit is set for any directory then any file inside that directory can be deleted by owner of that file or root even if it has 777 permission.

Sunil
*** Dream as if you'll live forever. Live as if you'll die today ***
Michael Tully
Honored Contributor

Re: directory permission.

The 't' means sticky bit. This is a common occurance on directories like /tmp and /var/tmp where anyone can write to the directory, but you can only remove your own files and not files owned by others.

quote from the chmod man page
If the sticky bit is set on a directory, files inside the directory
may be renamed or removed only by the owner of the file, the owner of
the directory, or the superuser (even if the modes of the directory
would otherwise allow such an operation).
Anyone for a Mutiny ?
Victor Fridyev
Honored Contributor

Re: directory permission.

Hi,

This bit should permit files removing in this directory only to the files owner.


RTFM for chmod
chmod(1)


t Add or delete the save-text-image-on-file-
execution (sticky bit) permission. Useful
only if u is expressed or implied in who.
See chmod(2).

HTH
Entities are not to be multiplied beyond necessity - RTFM
Franky_1
Respected Contributor

Re: directory permission.

Hi,

it's the so called "Sticky Bit" which means that any file inside can only be deleted by the owner respectively by root (even when set to 777)

Regards

Franky
Don't worry be happy