1

I'd appreciate help with a couple questions regarding standard file permissions. Assume that I'm not using access control lists.

  1. If a file is associated with multiple groups, must all groups have the same permissions?
  2. If the group permission includes write access, can any member of any group the file is associated with change the file permissions? Can such a person change the file owner?
  3. Say now the file permission is rwxr----- (owner can do everything, but group members can only read). I am in the group associated with the file. I am also the file owner. Which permission am I granted? Read-only, or rwx?
  • By the way, I have not found a good resource describing file permissions. If anyone can point to helpful resources, that would appreciated as well. – Tosh Jun 19 '15 at 5:58
  • What do you mean by "file associated with multiple groups"? – mikewhatever Jun 19 '15 at 6:21
  • I was stupid. I did not realize a file can only have one group owner. – Tosh Jun 19 '15 at 6:21
3
  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. ;)

  • Thanks A.B. So this means I as the file owner can assign r-- group permissions to a file, and someone in the group can change it to rwx? – Tosh Jun 19 '15 at 6:23
  • Sorry, no, I have corrected my answer – A.B. Jun 19 '15 at 6:26
  • See my corrected answer, sorry again. – A.B. Jun 19 '15 at 6:30
  • Just saw the link - interesting. – Tosh Jun 19 '15 at 6:51

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.