Mac-Operation not permitted

最近在mac上操作文件发现提示

chmod: Unable to change file mode on /usr/bin/cc: Operation not permitted
1
发现是El Capitan(10.11) 加入了Rootless机制,很多系统目录不再能够随心所欲的读写了,即使设置 root 权限也不行。

以下路径无法写和执行

/System
/bin
/sbin
/usr (except /usr/local)
1
2
3
4
加入这个机制主要是为了防止恶意程序的入侵,更多我们可以查看官网

https://developer.apple.com/videos/play/wwdc2015/706/

如何关闭
重启按住 Command+R,进入恢复模式,打开Terminal

1
csrutil disable

如何开启
重启按住 Command+R,进入恢复模式,打开Terminal。

1
csrutil enable

有问题可以联系博主

转载请注明出处,谢谢