2

I am trying to manually modify preferences file located at

/Library/Preferences/SystemConfiguration/preferences.plist

To modify it, I need to give it read&write permission. I did that. The problem is that the file is in a folder, for which I cannot change permission (I am admin and I have no access), nor do I want to change permissions to the whole folder for security reasons. I only want to change it for preferences.plist file. How can I achieve this?

These are the pop-ups I get when trying to modify it.

enter image description here

enter image description here

Upon modifying permissions to parent folder I get this:

enter image description here

sanjihan
  • 2,705
  • It's probably SIP - see http://apple.stackexchange.com/questions/208478/how-do-i-disable-system-integrity-protection-sip-aka-rootless-on-os-x-10-11 – Tetsujin Mar 24 '16 at 20:09
  • hmm, I just want to lower the walls for 1 file. Strange that Apple forces disabling for every file.. – sanjihan Mar 24 '16 at 20:13

1 Answers1

2

To allow user_name writing to preferences.plist add an ACL with:

sudo chmod +a "user_name allow write" /Library/Preferences/SystemConfiguration/preferences.plist

This changes the output of:

ls -laeO /Library/Preferences/SystemConfiguration/preferences.plist
-rw-r--r--  1 root  wheel  - 59715  9 Feb 23:25 /Library/Preferences/SystemConfiguration/preferences.plist

to:

ls -laeO /Library/Preferences/SystemConfiguration/preferences.plist
-rw-r--r--+ 1 root  wheel  - 59715  9 Feb 23:25 /Library/Preferences/SystemConfiguration/preferences.plist
0: user:user_name allow write

but doesn't change the permissions of the superior folder or other files residing in the same folder:

drwxr-xr-x  15 root      admin        -             510 24 Mär 17:23 SystemConfiguration

To remove the ACL later simply enter:

sudo chmod -a "user_name allow write" /Library/Preferences/SystemConfiguration/preferences.plist
klanomath
  • 66,391
  • 9
  • 130
  • 201
  • I ended up disabling SIP and giving the right permission to parent folder, but this seem like a nice answer. – sanjihan Mar 24 '16 at 21:13