1

Unix files have two kinds of ownership: user and group, each with its own permissions. Normally, the owner of a file should have full access to it, whereas members of a work group to which the owner belongs might have limited access, and everyone else, even less access. This last category is called other in Unix documentation.

For a file,

  • are the permissions for its work group necessarily permissions of its user owner?

    Since its user owner is a member of its work group, I guess the answer is yes, unless its work group excludes its user owner in the case of permissions. The permissions of its user owner may be more than those of its work group.

  • are the permissions for its user owner necessarily permissions of other?

    Some said 'other' means the entire world. In that sense its work group should be a subset of 'other', so I guess the answer is yes, unless 'other' excludes its work group. The permissions of its work group may be more than those of 'other'.

If it matters, I am focusing on Linux.

2

Permissions under Unix-like systems use an octal representation.

It begins with an optional special permission, followed by user, group, others. u, g, and o permissions are a combination of the following ORed together:

  • read: 4
  • write: 2
  • execute: 1

Therefore, the permission 0774 would allow its owner and group full access but read-only access to others.

Those permissions, including the special permission, are independent from one another.

Files also have a single owner and group, which are also independent, in their attributes.

It is therefore possible for the owner to have read-only access while members of groupX have read-write access, and people not matching either owner or group criteria having full access.

Lets consider user john that changes permissions of text.txt to 0467, ownership to john, and group to operator:

$ chown john:operator text.txt
$ chmod 0467 text.txt
$ ls -l text.txt
-r--rw-rwx 1 john operator 0 Dec 29 00:57 text.txt

If john is not part of the operator group, he will not be able to update the file contents:

$ echo hi > text.txt
text.txt: Permission denied

But he can still change the permissions on the file, and update the file:

$ chmod u+w text.txt
$ echo hi > text.txt
$ ls -l text.txt
-rw-rw-rwx 1 john operator 3 Dec 29 00:57 text.txt

Note that accessing a file also involves folder permissions throughout the directory tree.

  • Thanks. For a file, Is its user owner a member of its work group? Is its work group a subset of 'other'? In your example, must 'john' be a member of the 'operator' group, and must the 'operator' group a subset of 'other'? – Tim Dec 29 '16 at 6:10
  • 1
    What I say is that they are independent. In my example, john is not in the operator group and therefore can not update the file even if he is the owner. – Julie Pelletier Dec 29 '16 at 6:13
  • Is 'other' defined as all except its user owner and its work group? – Tim Dec 29 '16 at 6:15
  • That is right. As shown in my example, john would not have had a permission error if others included his account. – Julie Pelletier Dec 29 '16 at 6:20
  • If 'john' is a member of the 'operator' group, must his permissions include the permissions of the group? Otherwise, it doesn't seem consistent. – Tim Dec 29 '16 at 6:21

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.