macos - 当`sudo`和`bypass`不起作用时如何避免macOS上的“不允许操作”
问题描述
在 macOS(High Sierra)上,当我尝试在路径中列出文件时
/private/var/db/ConfigurationProfiles/Store
我收到错误“ Operation not permitted
”。使用sudo
并不能改善它,甚至使用bypass
助手也不会改变任何东西:
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
。
解决方案
最可能的原因是系统完整性保护 (SIP) -csrutil
是命令行实用程序。您需要禁用它才能查看目录。
- 要查看您的状态,您需要:
csrutil status
- 要禁用它(这通常是个坏主意):
csrutil disable
(那么您可能需要重新启动)。
- 要启用它(完成后应重新打开):
csrutil enable
推荐阅读
- javascript - JQuery 文件不建议在外部文件中
- testcontainers - Testcontainers/LocalStack 是否与 DynamoDb Streams KCL 1.x 一起使用?
- python - 'ReverseManyToOneDescriptor' 对象没有属性 'filter'
- javascript - VuetifyJs 工具提示中的可点击内容
- logistic-regression - 逻辑模型错误:奇异矩阵,同时具有高度相关的分类虚拟对象
- linq - Linq to sql,查询多对多与其他计数
- java - 如何总结对象流的数值属性?
- r - R-markdown 不断评估评论 - 这是预期的行为吗?
- html - 无法根据 Shopify 上的库存水平更新“添加到购物车”按钮
- c - 为什么第一个for循环递减?