# Mac 解决 "Operation not permitted" 权限问题

```
chmod: Unable to change file mode on /usr/bin/cc: Operation not permitted
```

发现是El Capitan（10.11） 加入了Rootless机制，很多系统目录不再能够随心所欲的读写了，即使设置 root 权限也不行。

以下路径无法写和执行

```
/System
/bin
/sbin
/usr (except /usr/local)
```

加入这个机制主要是为了防止恶意程序的入侵，更多我们可以查看官网

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

* 如何关闭

  重启按住 Command+R，进入恢复模式，打开Terminal

`csrutil disable`

* 如何开启

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

`csrutil enable`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://notes.ronething.cn/mac-operation-not-permitted-solution.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
