I am trying to edit /System/Library/LaunchDaemons/com.apple.taskgated.plist on OS X El Capitan. The file permissions are
-rw-r--r-- 1 root wheel 601 17 Nov 2015 com.apple.taskgated.plist
My first try was sudo vi (filename) and then use w! after editing but vi still reports read only status.
My second try was to use nano with sudo - same problem.
My third try was sudo su then edit the file - same problem.
My fourth try was vi (filename), write as temporary file then sudo cp (temp file) (filename) - operation not permitted.
I would like to know a) how to fix the problem and b) what I have misunderstood - I thought that I have full root access via sudo or sudo su and root has write permission on this file...