"限制"文件夹/文件在OS X El Capitan [英] "restricted" folder/files in OS X El Capitan

查看:149
本文介绍了"限制"文件夹/文件在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的情况下编辑受限制的文件/文件夹。


  1. reboot

  2. 只要您听到灰色屏幕上的Mac声音,按Cmd + R进入恢复模式

  3. 打开实用程序 - >终端

  4. 运行命令 csrutil disable

  5. 重新启动,您将登陆正常的操作系统,禁用SIP

  6. 执行您想要做的所有更改

  7. 重新启动

  8. 一旦您听到灰色屏幕上的Mac声音,按Cmd + R进入恢复模式

  9. 使用启用SIP csrutil enable

  10. 重新启动

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

  1. reboot
  2. as soon as you hear the "Mac sound" on the grey screen, press Cmd+R to enter Recovery mode
  3. Open Utilities->Terminal
  4. Run the command csrutil disable
  5. Reboot, you'll land in the normal OS with SIP disabled
  6. do all the changes you'd like to do
  7. Reboot again
  8. as soon as you hear the "Mac sound" on the grey screen, press Cmd+R to enter Recovery mode
  9. Enable SIP with csrutil enable
  10. Reboot again
  11. done

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

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