Edit system files

Hi,


I need to edit system property files, for instance in /System/Library/LaunchDaemons/ but it seems I'm not allowed to. I have tried using sudo and I also tried to enable the root account, but even as the root user I get the error "ftp.plist" E212: Can't open file for writing. (Using vim in this case. ftp.plist is just an example, it is the same for all files.)


Editing a file in a different location is no problem, but I still can't copy the file back to LaunchDaemons so it doesn't help.


I'm not even allowed to chmod files or the LaunchDaemons directory as the root user:

Library root# chmod 777 LaunchDaemons

chmod: Unable to change file mode on LaunchDaemons: Operation not permitted


Just to verify that I'm really running as root:

Library root# id

uid=0(root) gid=0(wheel) groups=...


ls -n shows that the owner of LaunchDaemons and all the files in it is root (0), so I find this really strange.

Searching the archives here I find several threads where folks are editing these files, so I must be doing something fundamentally wrong...


Are there recent changes in El Capitan that prevents editing these files?

MacBook Pro with Retina display, OS X El Capitan (10.11.2)

Posted on Jan 7, 2016 9:42 AM

Reply
Question marked as ⚠️ Top-ranking reply

Posted on Jan 7, 2016 11:47 AM

System Integrity Protection in El Capitan intentionally prevents anyone from messing with system files, or any apps installed by OS X. The intent is to prevent Trojans or other malware from installing anything that could root itself into the system (kext files or any modification to OS files or the installed apps).


You need to use Terminal while booted to the Recovery partition to turn it off. Make your modifications and then turn it back on.

3 replies
Sort By: 
Question marked as ⚠️ Top-ranking reply

Jan 7, 2016 11:47 AM in response to JesperIRL

System Integrity Protection in El Capitan intentionally prevents anyone from messing with system files, or any apps installed by OS X. The intent is to prevent Trojans or other malware from installing anything that could root itself into the system (kext files or any modification to OS files or the installed apps).


You need to use Terminal while booted to the Recovery partition to turn it off. Make your modifications and then turn it back on.

Reply

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Edit system files

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.