“受限"OS X El Capitan 中的文件夹/文件 [英] "restricted" folder/files in OS X El Capitan

查看:28
本文介绍了“受限"OS X El Capitan 中的文件夹/文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从 OS X Yosemite 升级到 OS X El Capitan Developer Preview 后,我尝试编辑 /System/Library/LaunchDaemons/ssh.plist 将默认 SSH 端口更改为自定义端口.这是我已经使用了几年的过程.

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.

问题是 El Capitan 不允许我更改此文件夹中的任何内容(即使使用sudo"也不行).当我使用 "ls -lO" 列出内容时,文件夹及其文件被标记为 "restricted".以前版本的 OS X 中的相同文件夹列表未显示受限".

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".

这是 OS X El Capitan 的新功能吗?如何编辑受限"的文件/文件夹?

Is this something new to OS X El Capitan? How can I edit files/folders that are "restricted"?

我发现这是由于 El Capitan 中引入的一项名为 SIP"(系统完整性保护)的新功能所致.

I found out this is due to a new feature introduced in El Capitan called "SIP" (System Intregrity Protection).

在此处阅读更多信息:https://forums.developer.apple.com/thread/4731?q=SIP

不幸的是,没有人建议一种在不实际禁用 SIP 的情况下编辑受限"文件/文件夹的方法.

Unfortunately, no one suggested a way of editing "restricted" files/folders without actually disabling SIP.

推荐答案

您也可以通过以下方式暂时禁用SIP

You can also temporarily disable SIP the following way

  1. 重启
  2. 当您在灰色屏幕上听到Mac 声音"时,按 Cmd+R 进入恢复模式
  3. 打开实用程序->终端
  4. 运行命令csrutil disable
  5. 重新启动,您将进入禁用 SIP 的正常操作系统
  6. 做你想做的所有改变
  7. 再次重启
  8. 当您在灰色屏幕上听到Mac 声音"时,按 Cmd+R 进入恢复模式
  9. 使用 csrutil enable
  10. 启用 SIP
  11. 再次重启
  12. 完成

这篇关于“受限"OS X El Capitan 中的文件夹/文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆