0

I am trying to understand file permissions and wanted to know what the difference is between a user and a group and others. The article that I was reading stated that the first bit indicates if its a folder and the next three characters indicate read write and execute permissions for the user then for the group and then for others. I wanted to know what the difference is between a user , group and others. Primarily between a user and a group.

3

Some history: Unix was originally written as a multiuser system; Linux inherited this and so does all its derivatives, including Mac OSX. On a multiuser system, you may have several groups of users who wish to share files, but who may wish to keep the contents private or otherwise limit access. Hence every file is defined as being owned by a specific user in a specific group. Users can belong to several groups.The command groups (on Linux) will list the groups where you are a member.

When you attempt to access a file, the system first checks if your user matches the user who is owner of the file; if so, the user permissions are used.

If you are not the user who owns the file, the next check is if you are a member of the group which is the group 'owner' of the file; if so the group permissions are used.

Finally, if both the above have failed (you are neither the owner of the file nor do you belong to the group given) then the world (others) permissions are used.

Often, the permissions for group and others are the same. For example, you may have a file which you can read and write to, but anyone else, whether they are working with you or not, can only read. Another common set is for user to have read and write, group members can read, but others have no access.

Of course, today, most desktop/laptop systems only have a single user, so there is little need for the group level, but it's still built into the system and is used by some system services which do need to cooperate.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.