hal*_*leo 12 macos file-io sudo
在 macOS (High Sierra) 上,当我尝试列出路径中的文件时
/private/var/db/ConfigurationProfiles/Store
Run Code Online (Sandbox Code Playgroud)
我收到错误“ Operation not permitted”。使用sudo并不会改善它,甚至使用bypass助手也不会改变任何东西:
sudo /System/Library/Extensions/TMSafetyNet.kext/Contents/Helpers/bypass ls -l /private/var/db/ConfigurationProfiles/Store
Run Code Online (Sandbox Code Playgroud)
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
Run Code Online (Sandbox Code Playgroud)
始终如一,但奇怪的Store是无法列出。ls当以当前用户身份执行和通过 执行时都会发生这种情况sudo。
Joh*_*tts 15
您可以尝试以下两件事......
有时“不允许操作”与权限有关,因此您可以尝试解决问题的一件事是进入有问题的文件夹的权限。
打开 Finder,然后找到导致操作失败的文件夹(例如“ls”)。
右键单击该文件夹,然后选择“获取信息”
添加用户对该文件夹有读/写权限;又名,添加您的用户个人资料(您)。
另一件事可能导致问题......可能是终端应用程序本身无法通过隐私火球访问数据。为了解决这个问题:
这应该允许终端访问相关文件夹。
欲了解更多信息: https://osxdaily.com/2018/10/09/fix-operation-not-permissed-terminal-error-macos/
最可能的原因是系统完整性保护 (SIP) -csrutil是命令行实用程序。您需要禁用它才能查看目录。
csrutil status
csrutil disable(然后您可能需要重新启动)。
csrutil enable
| 归档时间: |
|
| 查看次数: |
22884 次 |
| 最近记录: |