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?

Jeff Schaller
  • 66,199
  • 35
  • 114
  • 250
logger
  • 181
  • 1
  • 5

1 Answers1

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

Andy Dalton
  • 13,654
  • 1
  • 25
  • 45
  • 1
    That's about "Richacls" in particular, not POSIX ACL:s. It seems that Richacls was included in OpenSUSE, but [removed some years ago](http://opensuse-kernel.opensuse.narkive.com/pIjtDYia/richacl-patches-in-factoryremoved). And judging from [this post](https://lwn.net/Articles/718804/) 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