'S' linux 文件权限是什么意思

Mat*_*w24 10 linux permissions

我见过各种 Linux 文件权限,例如rwxrws,但从未见过权限集rwS。有人可以向我解释国会大厦'S'代表什么吗?

loo*_*ver 12

大写 S 表示该文件设置了 setuid 位但不可执行。

[root@host:/]$ touch file
[root@host:/]$ chmod 4755 file
[root@host:/]$ ls -l file
-rwsr-xr-x 1 root root 0 Jul 25 15:05 file
[root@host:/]$ chmod -x file
[root@host:/]$ ls -l file
-rwSr--r-- 1 root root 0 Jul 25 15:05 file
Run Code Online (Sandbox Code Playgroud)


Ign*_*ams 7

来自info ls "What information is listed"

    `S'
          If the set-user-ID or set-group-ID bit is set but the
          corresponding executable bit is not set.
Run Code Online (Sandbox Code Playgroud)