OS X EI Capitan SIP
在OS X 10.11中,苹果加入了一个SIP(System Integrity Protection)系统完整性保护的安全控制,导致像/System、/bin、/sbin、/usr等都被加上了一个特殊的restricted flag,从而不能被修改,即使是sudo。
例如,我们想在finder中显示/usr目录
sudo chflags nohidden /usr/
将会得到一个错误提示:
chflags: /usr/: Operation not permitted
因为/usr受到SIP的保护,导致不能作任何修改,若一定要这么做就需要关闭SIP保护。
- 重启系统进入恢复模式(Command + R)
- 打开Terminal工具
- 使用csrutil disable命令关闭SIP
- 重启系统,即可食用sudo做任何修改
强烈建议: 做完需要的操作后,通过同样的方式重新开启SIP保护csrutil enable。