Linux OS Internals (50 Qs)•Part 1: Basic & Foundational Concepts (Junior / Entry-Level)
What are SUID, SGID, and the Sticky Bit?
junior Levellinux-osBasic
In Simple Words: Special permission bits extending standard Unix permissions:
- SUID (
chmod 4755/u+s): Executable runs with the permissions of the file owner, not the executing user (e.g./usr/bin/passwdruns asrootso regular users can modify/etc/shadow). - SGID (
chmod 2755/g+s): Files created inside the directory inherit the group ownership of the directory, rather than the primary group of the user. - Sticky Bit (
chmod 1777/+t): Applied to shared directories (e.g./tmp); users can write files, but only the file owner or root can delete or rename their own files!