Starring:
Rooty McRootface – the all-powerful sysadmin
Sally Scriptkiddie – always poking around where she shouldn’t
Gary the Groupie – loves shared folders
Mr. Sticky – a janitor with attitude and a penchant for file hoarding
📚 Table of Contents
- Scene 1: “SUID Shenanigans”
- Scene 2: “SGID and the Shared Folder Fiasco”
- Scene 3: “Sticky Bit Mayhem on /tmp Street”
- End Scene: Recap With Laughs
Scene 1: “SUID Shenanigans”
(Cue laugh track)
Sally: “Hey Rooty, I just ran this /usr/bin/passwd command and it let me change MY password without sudo! Witchcraft??”
Rooty: “No, no, Sally. That’s just the SUID at work. It’s like a permission booster shot.”
🎭 SUID (Set User ID) is the bit that lets a user execute a file with the permissions of the file owner, usually root. Think of it like borrowing someone else's security badge for a moment — but legally.
🔍 How to spot it:
ls -l /usr/bin/passwd
You’ll see something like: -rwsr-xr-x
👓 That 's' in place of the owner's execute bit? That’s SUID saying “You may now speak as Root.”
Scene 2: “SGID and the Shared Folder Fiasco”
Gary the Groupie enters dramatically)
Gary: “Guys, I dropped a file into our shared folder, but now the group ownership is all over the place! Chaos!”
Rooty: “Gary… sigh… you forgot to set the SGID. It’s like the group policy of the Linux world.”
🎭 SGID (Set Group ID) ensures that new files in a directory inherit the group of the directory, not the user who created them.
🧹 Clean group collab = Set SGID.
How to set it:
Result:
drwxr-sr-x 2 root devteam 4096 cool-folder
(Cue applause as Gary sets the bit and the office breaks into spontaneous synchronized samba.)
Scene 3: “Sticky Bit Mayhem on /tmp Street”
(Enter Mr. Sticky, broom in hand)
Mr. Sticky: “Who the heck deleted my file from /tmp?! That was my lunch order receipt!”
Sally: “I thought /tmp was free-for-all! Like a community fridge.”
Rooty: “Sticky Bit to the rescue!”
🎭 The Sticky Bit prevents users from deleting files they don’t own in a shared directory — even if the directory has write access.
👷 Set it like so:
And now: drwxrwxrwt 10 root root 4096 /tmp
See that 't' at the end? That’s Linux saying, “Touch it if it’s yours. Hands off otherwise.”
(Mr. Sticky nods, victorious. Sally’s file-deleting privileges are revoked for the day.)
End Scene: Recap With Laughs
SUID: Be someone else (legally!) when running a file.
SGID: Keep it in the family (group).
Sticky Bit: Finders keepers, losers can’t delete it.
💬 Rooty: “Remember kids, with great permissions comes great audit trails.”
(Cue theme music: “You chmod Me Crazy”)