谁能解释为什么?
# whoami
root
# ls -ld /usr/sbin
drwxr-xr-x 246 root wheel 8364 Jan 3 14:36 /usr/sbin
# pwd
/
# touch test-file
# ls -ltr test-file
-rw-r--r-- 1 root wheel 0 Jan 10 00:27 test-file
# cp test-file /usr/sbin
cp: /usr/sbin/test-file: Operation not permitted
# ls -ld@ /usr/sbin
drwxr-xr-x 246 root wheel 8364 Jan 3 14:36 /usr/sbin
这是MACOS系统完整性保护(SIP),其防止甚至根从改变事物中/System
,/usr
,/bin
,/sbin
和预安装的应用。
可以写的/usr
是一个例外/usr/local
。
有关此内容的Apple支持文档在这里
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句