为什么chown
命令是 root-only?为什么非 root 用户不能使用 chown 来赠送他们拥有的文件?
我知道文件具有 suid 权限意味着什么。这意味着当其他用户对其具有执行权限时,他们以文件的所有者身份执行。但是当文件夹具有 suid 权限时,这意味着什么?我做了一些测试,该文件夹似乎没有什么特别之处。有人可以帮忙解释一下吗?谢谢。
我使用的是 Oracle Linux 7.6。
root:[~]# cat /etc/*release*
Oracle Linux Server release 7.6
NAME="Oracle Linux Server"
VERSION="7.6"
ID="ol"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="7.6"
PRETTY_NAME="Oracle Linux Server 7.6"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:oracle:linux:7:6:server"
HOME_URL="https://linux.oracle.com/"
BUG_REPORT_URL="https://bugzilla.oracle.com/"
ORACLE_BUGZILLA_PRODUCT="Oracle Linux 7"
ORACLE_BUGZILLA_PRODUCT_VERSION=7.6
ORACLE_SUPPORT_PRODUCT="Oracle Linux"
ORACLE_SUPPORT_PRODUCT_VERSION=7.6
Red Hat Enterprise Linux Server release 7.6 (Maipo)
Oracle Linux Server release 7.6
cpe:/o:oracle:linux:7:6:server
root:[~]#
Run Code Online (Sandbox Code Playgroud)
以下是我在新安装的服务器上的测试。
root:[~]# pwd
/root
root:[~]# ls -lad /root
dr-xr-x---. 9 root root 4096 Aug 16 22:07 /root
root:[~]# mkdir test
root:[~]# ls -lad test
drwxr-xr-x. …
Run Code Online (Sandbox Code Playgroud)