Su Must Be Suid To Work Properly |top|
In the architecture of Unix-like operating systems, few concepts are as fundamental—or as frequently misunderstood—as the divide between the regular user and the superuser (root). The command su (substitute user) is the gatekeeper between these two worlds. It allows a user to switch to another user account, most commonly the root account.
The SUID (Set User ID) bit is a special permission flag in the filesystem. When a binary has this bit set (visually represented by an s in the execute position, e.g., -rwsr-xr-x ), the behavior changes drastically at the moment of execution. su must be suid to work properly
On modern Linux systems, password hashes are stored in /etc/shadow . This file is strictly protected to prevent brute-force attacks by regular users. In the architecture of Unix-like operating systems, few
The SUID mechanism is a controlled violation of the standard security model. It allows a user to cross the boundary of "self" into the boundary of "other." The SUID (Set User ID) bit is a
Therefore, when alice runs the su binary (which is owned by root and has the SUID bit set), the resulting process does not run as alice . For all intents and purposes, the process is root from the moment it starts.