I am running the latest Sierra OS 10.12.2. Recently compiled some code and while I could run it from any directory, I noticed that I cannot put the program into /usr/sbin. The cp command, while running it as root, returns "operation not permitted"
Here is the output:
sh-3.2# ls -ld /Users/bytelogic
drwxr-xr-x+ 22 bytelogic staff 748 Jan 7 16:36 /Users/bytelogic
sh-3.2# ls -ld /usr/sbin
drwxr-xr-x 246 root wheel 8364 Jan 3 14:36 /usr/sbin
sh-3.2# whoami
root
sh-3.2# touch test-cp
sh-3.2# ls -la test-cp
-rw-r--r-- 1 root staff 0 Jan 8 11:18 test-cp
sh-3.2# cp test-cp /usr/sbin
cp: /usr/sbin/test-cp: Operation not permitted
sh-3.2# sudo cp test-cp /usr/sbin
cp: /usr/sbin/test-cp: Operation not permitted
sh-3.2#
The only thing that I can see is that after su root somehow is in group "staff" and not in "wheel".
Can anyone shed light on this? I am little rusty with the command line.... Mac support tells me they are not allowed to provide support for the terminal...
Here is the output:
sh-3.2# ls -ld /Users/bytelogic
drwxr-xr-x+ 22 bytelogic staff 748 Jan 7 16:36 /Users/bytelogic
sh-3.2# ls -ld /usr/sbin
drwxr-xr-x 246 root wheel 8364 Jan 3 14:36 /usr/sbin
sh-3.2# whoami
root
sh-3.2# touch test-cp
sh-3.2# ls -la test-cp
-rw-r--r-- 1 root staff 0 Jan 8 11:18 test-cp
sh-3.2# cp test-cp /usr/sbin
cp: /usr/sbin/test-cp: Operation not permitted
sh-3.2# sudo cp test-cp /usr/sbin
cp: /usr/sbin/test-cp: Operation not permitted
sh-3.2#
The only thing that I can see is that after su root somehow is in group "staff" and not in "wheel".
Can anyone shed light on this? I am little rusty with the command line.... Mac support tells me they are not allowed to provide support for the terminal...