Understanding Group Permissions

Solution 1:

  1. A file can only have one group

  2. Only the owner of the file can do that.

    $ sudo touch ~/tmp/test
    $ sudo chown root:aboettger ~/tmp/test
    $ ls -la ~/tmp/test
    -rw-rw-r-- 1 root aboettger 853 Jun 19 08:26 /home/aboettger/tmp/test
    $ chmod g-w ~/tmp/test 
    chmod: changing permissions of 'test': Operation not permitted
    
  3. You have rwx access rights

And you should read this. ;)