setuid (s) | setgid (s) | sticky (t) | |
---|---|---|---|
Directory | ignored | New subfiles inherit group | Only owner of subfile can (re)move it* |
File | Executes as file owner | Executes as group | ignored |
Sticky bit can be set with chmod
as the first of four digits, or using {+,-}s
(for setuid/setgid) and {+,-}t
(for sticky). For example, to enable setuid,
chmod u+s $FILE # Add setuid to a file
chmod 4755 $FILE # Possible permissions of /bin/ping