Posted by: ibmadmin | February 21, 2011

Sticky Bit in UNIX world

Sticky Bit

The sticky bit on a directory is a permission bit that protects files within that directory. If the directory has the sticky bit set, only the owner of the file, the owner of the directory, or root can delete the file. The sticky bit prevents a user from deleting other users’ files from public directories, such as uucppublic:

castle% ls -l /var/spool/uucppublic
drwxrwxrwt 2 uucp uucp 512 Sep 10 18:06 uucppublic
castle%
When you set up a public directory on a TMPFS temporary file system, make sure that you set the sticky bit manually.

You can set sticky bit permissions by using the chmod command to assign the octal value 1 as the first number in a series of four octal values. Use the following steps to set the sticky bit on a directory:

1. If you are not the owner of the file or directory, become superuser.
2. Type chmod and press Return.
3. Type ls -l and press Return to verify that the permissions of the file have changed.
The following example sets the sticky bit permission on the pubdir directory:

castle% chmod 1777 pubdir
castle% ls -l pubdir
drwxrwxrwt 2 winsor staff 512 Jul 15 21:23 pubdir
castle%

Ref: http://snap.nlc.dcccd.edu/reference/sysadmin/julian/ch18/402-404.html#Heading32

Advertisements

Responses

  1. Sticky bit concept is only for directories not for a file. This sticky bit protect files inside a directory where sticky bit is turned on.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: