Solved Operation not permitted when chmod with root

I have an odd problem that occurs sometimes. I'll explain the symptoms of the latest occurrence:

I ssh to the host as a user and then elevate to root. I change directory into a ZFS dataset containing files and directories I want to change permissions on. That's when I pop it:

# chmod -R 644 directory/

Instead of the expected # I get a whole bunch of:

chmod: directory: Operation not permitted
chmod: directory/file: Operation not permitted
chmod: directory/other-file: Operation not permitted


Stumped, I asked myself:

# whoami
root


Any idea as to what I've broken, how I can find out or how I can fix it? Thanks.
 
Could it be that the containing directory is read only?
 
I have an odd problem that occurs sometimes. I'll explain the symptoms of the latest occurrence:

I ssh to the host as a user and then elevate to root. I change directory into a ZFS dataset containing files and directories I want to change permissions on. That's when I pop it:

# chmod -R 644 directory/

Instead of the expected # I get a whole bunch of:

chmod: directory: Operation not permitted
chmod: directory/file: Operation not permitted
chmod: directory/other-file: Operation not permitted


Stumped, I asked myself:

# whoami
root


Any idea as to what I've broken, how I can find out or how I can fix it? Thanks.
Try the following:
# chflags -R noschg directory

Then again:
# chmod -R 644 directory

See chflags(1).
 
Could it be that the containing directory is read only?
I can create files in the directory, just not change permissions.
# touch test
# ls -la
total 120
drwxrwxr-x+ 6 parski parski 8 Nov 24 15:09 .
drwxrwxrwx+ 77 root wheel 77 Nov 24 10:02 ..
-rwxrwxr-x+ 1 root parski 0 Nov 24 15:09 test
# chmod 644 test
chmod: test: Operation not permitted
# rm test
#


Try the following:
# chflags -R noschg directory

Then again:
# chmod -R 644 directory

See chflags(1).
I could run the command but it hasn't changed the fact that I can't change permissions.

I don't understand.
 
IIRC that plus sign at the end of permissions means that there are ACLs set. You could check if there is one that is causing you trouble.
 
Check ACL permissions. The folder might have inherited the permissions from a partition or parent folder used for some specific services e.g. Samba.
 
IIRC that plus sign at the end of permissions means that there are ACLs set. You could check if there is one that is causing you trouble.
Wow! I thought I knew Unix permissions. This was exactly the problem.

I quickly tried to enable NFS somee time ago and didn't read adequately before doing so. Shame on me.

Thank you for helping me!
 
Back
Top