What do the setuid, setgid and sticky bits do?

- setuid (4) on an executable: it runs with the file owner's privileges (e.g. /usr/bin/passwd). - setgid (2) on an executable runs with the group's privileges; on a directory, new files inherit the directory's group. - sticky (1) on a directory: only a file's owner (or root) can delete it, as on /tmp.

bash chmod 1777 /shared sticky chmod g+s /project setgid dir