"限制"文件夹/文件在OS X El Capitan [英] "restricted" folder/files in OS X El Capitan
问题描述
从OS X Yosemite升级到OS X El Capitan Developer Preview后,我尝试编辑 /System/Library/LaunchDaemons/ssh.plist 将默认SSH端口更改为自定义。这是我已经使用了几年的过程。
问题是,El Capitan不允许我更改此文件夹中的任何内容(甚至不与sudo)。当我使用ls -lO列出内容时,文件夹及其文件被标记为受限制。以前版本的OS X中的同一文件夹列表不显示受限制。
这是OS X El Capitan的新功能吗?如何编辑限制的文件/文件夹?
我发现这个是由于在 El Capitan 中引入的新功能SIP(系统Intregrity Protection)。
读取更多在这里: https://forums.developer.apple.com/thread/4731?q=SIP
不幸的是,没有人建议在没有实际禁用SIP的情况下编辑受限制的文件/文件夹。
- reboot
- 只要您听到灰色屏幕上的Mac声音,按Cmd + R进入恢复模式
- 打开实用程序 - >终端
- 运行命令
csrutil disable
- 重新启动,您将登陆正常的操作系统,禁用SIP
- 执行您想要做的所有更改
- 重新启动
- 一旦您听到灰色屏幕上的Mac声音,按Cmd + R进入恢复模式
- 使用
启用SIP csrutil enable
- 重新启动
- done
-
After upgrading from OS X Yosemite to OS X El Capitan Developer Preview, I tried to edit /System/Library/LaunchDaemons/ssh.plist to change the default SSH port to a custom one. This is the process I've been using for a couple of years.
The problem is that El Capitan doesn't allow me to change anything in this folder (not even with "sudo"). The folder and its files are marked as "restricted" when I list the contents with "ls -lO". The same folder listing in previous versions of OS X does not show "restricted".
Is this something new to OS X El Capitan? How can I edit files/folders that are "restricted"?
I found out this is due to a new feature introduced in El Capitan called "SIP" (System Intregrity Protection).
Read more here: https://forums.developer.apple.com/thread/4731?q=SIP
Unfortunately, no one suggested a way of editing "restricted" files/folders without actually disabling SIP.
You can also temporarily disable SIP the following way
- reboot
- as soon as you hear the "Mac sound" on the grey screen, press Cmd+R to enter Recovery mode
- Open Utilities->Terminal
- Run the command
csrutil disable
- Reboot, you'll land in the normal OS with SIP disabled
- do all the changes you'd like to do
- Reboot again
- as soon as you hear the "Mac sound" on the grey screen, press Cmd+R to enter Recovery mode
- Enable SIP with
csrutil enable
- Reboot again
- done
这篇关于"限制"文件夹/文件在OS X El Capitan的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!