TECH SOLUTIONS

Click here to edit subtitle

Forums

Post Reply
Forum Home > Unix Learnings > Sticky bit- Only user of the file or the directory owner or root user can delete files in directory

Sourav Gulati
Site Owner
Posts: 83

Suppose if you want that any user can create files in the directory but no user can delete files created by any other user , then set sticky bit permission on the directory.

Syntax: 

$ chmod +t dir_name

now if you check permission on directory , you would see an extra 't' permission on the directory.

$ ls -ld dir_name

drwxrwxrwt 3 dir_owner dir_owner_group 4096 Nov 21 12:35 dir_name

Now , any user can create files in this directory but no user can delete files of other users from this directory except dir_owner and root user

--


November 21, 2012 at 2:16 AM Flag Quote & Reply

You must login to post.