• Mac OSX 目录操作遇到 Operation not permitted 问题

    18-12-12 11:41 28031 0 技术

    今天在安装 PHP 扩展的时候发现使用 sudo 还依然提示 “Operation not permitted”。

    这是由于 10.13 版本加强了权限的限制,即 rootless 机制,可以进入恢复模式关闭 rootless 机制。

    官方说明:https://developer.apple.com/videos/play/wwdc2015/706/

    解决方案

    1. 重启 Mac,按 Command + R(Win 键盘:win + R)进入恢复模式

    2. 打开终端,输入命令:

      csrutil disable
      
    3. 重启后让机器正常启动,可以在终端查看 rootless 状态:

      csrutil status
      

      显示

      System Integrity Protection status: disabled.
      

      正常情况下 rootless 已经关闭。

    4. 要想重新开启 rootless 机制,参考步骤 1,输入命令:

      csrutil enable
      

文章归档

文章日历

2018 年 12 月
26 27 28 29 30 31 01
02 03 04 05 06 07 08
09 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
31 01 02 03 04 05 06

文章标签

最新评论

友情链接