在 macOS (High Sierra) 上,当我尝试在路径中列出文件时
/private/var/db/ConfigurationProfiles/Store
我收到错误“
Operation not permitted
”。使用 sudo
并没有更好,甚至使用 bypass
helper 不会改变任何东西:sudo /System/Library/Extensions/TMSafetyNet.kext/Contents/Helpers/bypass ls -l /private/var/db/ConfigurationProfiles/Store
也给出“
Operation not permitted
”。如何列出/访问路径 /private/var/db/ConfigurationProfiles/Store
下的文件?附加信息:
通过
ls -al /private/var/db/ConfigurationProfiles
获得的封闭目录列表显示:drwxr-xr-x 5 root wheel 160 13 Apr 2018 .
drwxr-xr-x 85 root wheel 2720 28 Sep 06:27 ..
drwxr-xr-x@ 4 root wheel 128 16 Dec 2017 Settings
drwx------ 3 root wheel 96 1 Oct 21:56 Setup
ls: Store: Operation not permitted
始终如一,但很奇怪
Store
无法列出。执行 ls
时都会发生这种情况作为当前用户并通过 sudo
.
最佳答案
最可能的原因是 system integrity protection (SIP) - csrutil
是命令行实用程序。您需要禁用它才能查看目录。
csrutil status
csrutil disable
(然后您可能需要重新启动)。csrutil enable
关于macos - 当 "Operation not permitted"和 `sudo` 不起作用时,如何在 macOS 上避免 `bypass`,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58100326/