2

After I set the permission to have both groups added to different user I am still not able to change the permission for directory and files.

id adminOne
uid=495(adminOne) gid=492(apps) groups=492(apps),5002(shared)

id adminTwo
uid=7376(adminTwo) gid=5002(shared) groups=5002(shared),492(apps)

If I log in with adminOne I changed a shared folder such as test...

adminOne@UnixEB: chmod -R 777 test
chmod: changing permissions of `test': Operation not permitted

adminOne@UnixEB: ll
drwxrwx--- 7 adminTwo shared 4096 Nov 30 11:40 test

why I cannot change the permission when I already set the owner to both groups?

  • May be the folder has some extended attributes set? – Inian Nov 30 '17 at 18:02
  • what do you mean by extended attribute set? – logger Nov 30 '17 at 18:03
  • ACLs. Immutability. Read-only filesystem. There are many possibilities. – DopeGhoti Nov 30 '17 at 18:04
  • Is SELinux enabled? What is the output of getenforce? – Abhik Bose Nov 30 '17 at 18:08
  • 1
    With traditional (non-ACL) access rights, only the owner can change the permissions of a file. – Andy Dalton Nov 30 '17 at 18:10
1

I mentioned this in a comment above, but it's worth calling out again. Having write permissions does not give a non-owner the right to modify the permissions of a file – only the owner (or root) can change a file's permissions.

You may be able to use ACLs to enable what you're after; see: https://unix.stackexchange.com/a/75915/90691

  • 1
    That's about "Richacls" in particular, not POSIX ACL:s. It seems that Richacls was included in OpenSUSE, but removed some years ago. And judging from this post from April 2017, it's still not in mainline Linux either – ilkkachu Nov 30 '17 at 22:07
  • Yeah, that's why I qualified the comment with "may be able to". I'd never heard of Richacls, I was just referencing the related discussion. – Andy Dalton Nov 30 '17 at 22:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.