[Ilugc] One Day One GNU/Linux Command (CHMOD)

  • From: arunchaganty@xxxxxxxxx (Arun Tejasvi Chaganty)
  • Date: Tue Jun 17 15:39:42 2008

On Tue, 2008-06-17 at 09:58 +0530, Bharathi Subramanian wrote:

One Day One GNU/Linux Command
=============================

I think some mention should be made about the 'other' modes, namely the
sticky bit and the setuid bit.

chmod +t dir - Set the sticky bit for a directory. -t is to remove the
same
?chmod [u,g]+s file - Set the setuid bit for a file. -s is to remove the
same.

Note that all the above examples (Bharathi's) with mode numbers like
755, were implicitly 0755. If you use 1755 or 2755, you activate the
sticky bit or the setuid bit respectively. 3755 activates both.

The sticky bit allows only the owner to remove the file, though access
is allowed as per the remaining permissions. I've only seen it used on
the /tmp directory, and a few other places where it shouldn't have
been :-P.

The setuid (or guid) bit allows the program to run under a different
user (or group). Ex:
-rwsr-xr-x  1 root   root    22904 Apr 27  2003 /bin/su
when su is run (by anyone), it has the same access rights as the root
user. (as seend by the s instead of an x).

HTH
-- 
Arun Tejasvi Chaganty (vimzard)
GNOME GSoC Student
Blog: http://arunchaganty.wordpress.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : 
http://www.ae.iitm.ac.in/pipermail/ilugc/attachments/20080617/c7f079ab/attachment.bin

Other related posts: