如何关闭OSX 10.11 SIP (System Integr

作者: DerekMonster | 来源:发表于2015-10-05 12:14 被阅读32655次

    2017.12.7 10:09 更新:该文中提到的影响开发的问题,现在已不存在。除特殊情况外,不建议关闭该功能。

    1. 关于Homebrew的安装参考链接
    1. Cocoapods使用这个命令安装sudo gem install -n /usr/local/bin cocoapods原因是原来使用的/usr/bin这个目录被rootless保护了,那个-n参数作用是把二进制文件安装到指定目录,参考stackoverflow解决Cocoapods无法安装 注意stackoverflow中提到的使用这个参数「rootless=0」就不要用了,该方法apple官方已经封了,要停用rootless就用我下述的方法(也是官方推荐方法)
    2. ......暂时就这些,有问题在更新,或者留言给我你的问题,我看看能不能解决

    注意:SIP功能是Apple在OSX上推出的系统完整性保护功能,对于普通MAC用户来说是一项安全保护功能,如果不了解他的作用请不要随意关闭,对于开发者来说,因为会使用到很多的第三方辅助工具(例如:Cocoapods、Homebrew),而这些工具可能会修改系统目录,在这些工具未推出适应OSX 10.11的版本时,有必要临时关闭SIP以确保开发工具的使用。

    建议:普通用户随意,开发者目前请谨慎升级,如果你已经升级,相信你可能需要恶心一阵了,因为有些工具没有更新不能正常使用或部分功能失效,甚至在关闭SIP后也有点问题,当然你只要耐心等待软件更新和网友的智慧或是自己动手丰衣足食,很多问题还是可以解决的。

    1.进入RecoveryHD

    开机按住Option键在出现的启动选择菜单中选择RecoveryHD进入恢复模式

    2.使用csrutil命令

    打开终端Terminal,键入csrutil可以显示该命令的使用方法

    usage: csrutil <command>
    Modify the System Integrity Protection configuration. All configuration changes apply to the entire machine.
    Available commands:
    
        clear
            Clear the existing configuration. Only available in Recovery OS.
        disable
            Disable the protection on the machine. Only available in Recovery OS.
        enable
            Enable the protection on the machine. Only available in Recovery OS.
        status
            Display the current configuration.
    
        netboot
            add <address>
                Insert a new IPv4 address in the list of allowed NetBoot sources.
            list
                Print the list of allowed NetBoot sources.
            remove <address>
                Remove an IPv4 address from the list of allowed NetBoot sources.
    
    

    可以看到在正常系统模式下中仅可以用status命令查询SIP状态

    3.常用参数

    • clear:清除配置设置,等同于完全开启SIP(仅在恢复模式下有效)
    • disable:关闭SIP(仅在恢复模式下有效)
    • enable:开启SIP(仅在恢复模式下有效)
    • status:查询SIP状态

    4.常用参数进阶

    除了可以完全关闭/打开,还可以进行单项和多项组合关闭相关功能,用法如下

    csrutil enable [--without kext|fs|debug|dtrace|nvram] [--no-internal]
    

    单项使用:

    sudo csrutil enable –without fs:Filesystem Protections disable
    sudo csrutil enable –without kext:Kext Signing disable
    sudo csrutil enable –without debug:Debugging Restrictions disable
    sudo csrutil enable –without nvram:NVRAM Protections disable
    sudo csrutil enable –without dtrace:DTrace Restrictions disable
    

    组合使用:

    sudo csrutil enable –without kext –without fs:Filesystem Protections and Kext Signing are disabled
    

    更多详情请参考:
    可丁丹尼@一路往前走2.0
    csrutil updated in DP7
    SIP/Rootless Internal in El Capitan

    相关文章

      网友评论

        本文标题:如何关闭OSX 10.11 SIP (System Integr

        本文链接:https://www.haomeiwen.com/subject/nzbgcttx.html