TL;DR: Why am I getting the Operation not permitted? And how can I resolve this?
I'm facing a problem which I can't resolve. I'm creating a directory as user a:group a), which I want to change to user b:group a. I don't understand why this operation is not permitted. This is what's happening:
user a@foo:~$ mkdir /home/user b/foo/test uber a@foo:~$ chmod 0777 /home/user b/foo/test user a@foo:~$ ls -alF /home/user b/foo/ | grep test drwxrwxrwx 2 user a group a 4096 Jan 6 19:53 test/ user a@foo:~$ chown user b:group a /home/user b/foo/test chown: changing ownership of `/home/user b/foo/test': Operation not permitted
(I changed the user and group names for simplicity's sake)
Other things that might be relevant:
- User A is in Group A and Group B.
- User B is in Group B.
- Directory foo in /home/user b has 0750, and is owned to User B:Group A.
I'm eager to understand as why this operation is not permitted, and how I can resolve this (a solution without using sudo is a plus)?