LLI Wiki — My Digital Knowledge Base

setuid, setgid and sticky bits with chmod

Meaning of the setuid, setgid and sticky bits in chmod octal modes on Linux.

The setuid, setgid and sticky bits are set with an extra digit placed in front of the octal mode used by chmod. The table below summarises the possible values.

Values of the special digit

Digit Active bits
0 None (setuid, setgid and sticky off)
1 Sticky
2 setgid
3 setgid and sticky
4 setuid
5 setuid and sticky
6 setuid and setgid
7 setuid, setgid and sticky

Effect on a directory

Effect on an executable file

Mastodon LLIMastodon SocialFosstodon