LOGBOOK

HELP

Quiz Entry - updated: 2026.06.20

What are practical examples of SUID, SGID, and Sticky Bit?

passwd carries SUID-root so any user can edit root-only /etc/shadow; a shared dir gets SGID (chmod 2775) so files inherit the team group; /tmp carries the sticky bit (chmod 1777) so users can't delete each other's files.

Each example maps to one of the three bits doing exactly the job the plain rwx model couldn't: borrow an owner's identity (SUID), unify group ownership in a directory (SGID), or fence off deletion in a world-writable directory (sticky).

SUID examples:

ls -l /usr/bin/passwd
-rwsr-xr-x 1 root root 50488 ... /usr/bin/passwd
  • Allows any user to change their password
  • Needs root access to modify /etc/shadow
  • Without SUID, users couldn't change passwords
ls -l /usr/bin/mount
-rwsr-xr-x 1 root root 33544 ... /usr/bin/mount
  • Allows regular users to mount filesystems (when permitted)

SGID directory example:

mkdir /shared
chown :developers /shared
chmod 2775 /shared
  • All files created in /shared inherit developers group
  • Great for team collaboration directories

Sticky Bit example - /tmp:

ls -ld /tmp
drwxrwxrwt 10 root root 4096 ... /tmp
  • Everyone can create files
  • Only file owner can delete their own files
  • Prevents users from deleting each other's temp files

Security note: SUID on shell scripts is dangerous - Linux ignores it for scripts (only binaries).

From Quiz: LIOS / User Management and Permissions | Updated: Jun 20, 2026