SUID
Cheat sheet · https://pcornel.dk/topic.php?topic=2708
Answer
SUID (set-user-ID, mode 4xxx, s in the owner execute position) makes a program run with its file owner's privileges — e.g. /usr/bin/passwd runs as root to update /etc/shadow.
Remember
SUID on a script is ignored by Linux; it only works on binaries. Every SUID-root binary is an attack surface — audit them and remove the bit where not needed. Mount options nosuid disable it on a filesystem.
First checks
find / -xdev -perm -4000 -type f— SUID filesls -l <path>— owner, group and modestat -c '%A %a %U:%G' <path>— symbolic and numeric mode with ownernamei -l <path>— permissions of every directory on the pathid <user>— user's groups
Commands
sudomountping
Verify in this order
binary with SUID bit executed → process gets the file owner's effective UID → runs with that privilege
Where it usually breaks
First mismatch in identity/group resolution → Unix mode/ACL/capability → mount/sandbox constraint → SELinux/AppArmor policy → credential/TLS trust → protected operation; preserve identity/native diagnostic/pre-state before mutation.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=2708