$linuxjunkies
>

setuid

also: set user ID, setuid bit, suid

A special file permission bit that allows a program to execute with the permissions of its owner rather than the user running it. Commonly used to grant temporary elevated privileges for specific tasks.

The setuid (set user ID) bit is a special permission flag on executable files. When set, the program runs with the effective user ID of the file's owner, not the person executing it. This is essential for programs that need elevated privileges to perform their function.

For example, the passwd command needs setuid to allow regular users to change their own passwords, since password changes require writing to the /etc/shadow file (owned by root). Without setuid, only root could run it.

You can identify setuid permission by an 's' in the owner execute position: -rwsr-xr-x. Set it with chmod u+s filename or chmod 4755 filename. Use setuid cautiously—it's a common security attack vector if misconfigured.

Related terms