I'm trying to copy under root file into /System folder. It works well on all previous OS X version but not on El Capitan 10.11
Here how I copy file under root in terminal:
MACMINI:~ myusername$ sudo su -
MACMINI:~ root# cp /Users/myusername/Desktop/myfile.plist /System/Library/LaunchDaemons/
As result I receive an error:
cp: /System/Library/LaunchDaemons/myfile.plist: Operation not permitted
Considering that certain system directories are protected from being written at all (even with root) under OS X 10.11 (El Capitan) unless security measurements are disabled (see answer by Chris Ostmo) it's obviously a good idea to not modify those directories at all with custom system hacks.
Own LaunchDaemons should be installed to:
/Library/LaunchDaemons/
(not /System/Library/LaunchDaemons/)