I need to edit a script in /usr/bin, but the system won't me let do it because the SIP. How can I do it? It's a PHP script needed for my development environment.
Asked
Active
Viewed 9,583 times
1
Giacomo1968
- 55,001
delphirules
- 749
1 Answers
6
In general, the best answer is: don't. Changing things in the protected directories may break parts of the OS that use them. Local customizations belong in /usr/local rather than the main hierarchy, and /usr/local/bin is already in the default PATH (and before /usr/bin and /bin, so commands there will be used in preference to the builtins). Just put the modified script there, and it should work for most purposes.
If you do need to make mods in /usr/bin, you can turn off filesystem protection by restarting in recovery mode, and running the command:
csrutil enable --without fs
...then restart normally, do the changes, then restart in recovery again, run csrutil enable, and restart again. See Rich Trouton's blog for way more information.
Gordon Davisson
- 34,729
/usr/bin/to begin with? – Giacomo1968 Oct 01 '18 at 23:39