Search CTRL + K

Set UID

SUID 是 Linux 文件特殊权限之一,作用于可执行文件才有意义,效果是以文件所有者的用户 ID 执行,而不是执行者。

/usr/bin/passwd 文件为例:

~
❯ ls -al /usr/bin/passwd
.rwsr-xr-x 77k root  3 Mar 00:45 /usr/bin/passwd

如果文件所有者不包含执行权限,则会显示为大写 S

有两个方法设置 SUID:

user + s (pecial)

Commonly noted as SUID, the special permission for the user access level has a single function: A file with SUID always executes as the user who owns the file, regardless of the user passing the command. If the file owner doesn't have execute permissions, then use an uppercase S here.[1]


  1. https://www.redhat.com/sysadmin/suid-sgid-sticky-bit ↩︎