What is sticky bit?

When this is set on a directory, only the file in that directory can be removed or renamed if:
1. User owns the directory
2. User owns the file
3. Super User

Questions by sridhar_madadi   answers by sridhar_madadi

Showing Answers 1 - 17 of 17 Answers

  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"

    chmod 1777 project_dir

The sticky bit is displayed as the letter t in the execute field  for 'others'.

  Was this answer useful?  Yes

anandd

  • Jul 2nd, 2006
 

The Sticky Bit is a special permission that protects the files within a publically writable directory.

If the directory has the Sticky Bit set, a file can be deleted only by the owner of the file, the owner of the directory, or by root. This prevents a user from deleting other users? files from publicly writable directories.

  Was this answer useful?  Yes

Mohammed Mujahid

  • Feb 2nd, 2007
 

It is apply to files and directories.The user who has created the file/directory only he and root can delete others can not delete the directory.

  Was this answer useful?  Yes

It is the one utility in Solaris, by this we need to restrict the users to delete the files & dir in the file system (mount point). Only the authorised users can access.

  Was this answer useful?  Yes

nidipa dias

  • Nov 3rd, 2016
 

Sticky bit is the special permission for files and directories.
If we set sticky bit to one file or directory, the owner of the file/directory or the root user only have permission to delete or rename the file or directory.

For example:
/tmp directory in the Linux system that can be used by different Linux users to create temporary files. Now, what if an user accidentally or deliberately deletes (or rename) a file created by some other user in this directory? In that scenario we can use sticky bit.

  Was this answer useful?  Yes

rajesh

  • Jul 3rd, 2017
 

When user is the owner of the file, in that case user will able to delete the file

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions