2

I've had a lot of arguments about file permissions, and I want to know if there's any difference at all between user vs. group permissions. For example:

If I have a file with two possible configurations:

-rw-rw---- 1 root www-data 5 Jan 6 10:44 test

-rw-rw---- 1 www-data www-data 5 Jan 6 10:44 test

If I change ownership to the second one, is www-data gaining any privileges that it didn't have when it could only access the file via group permissions?

2

In the example you've given there would be no difference in the way that the www-data user could affect the file. In both instances, if there were other users in the www-data group, they would also have rw permissions on that file.

The only difference that comes to mind between user and group permissions, would be files within any directories that have the 'sticky bit' set on them. This would mean that only the owner of the parent directory, owner of the file, or root could move, delete or rename the file.

More info on the sticky bit can be found in the Ubuntu file permissions page fairly far down the page.

1
  • Cheers @kos I'll edit it now.
    – Arronical
    Jan 6 '16 at 17:25
1

I am not sure there is any real difference on a single user system. But on a multiuser system there sure is.

Example - Say you have a server with a total of 10 users, but you wish to allow web access to 3 of the 10 users. In that case you would add the 3 users to the group www-data and allow group modification.

If you need finer grain control, you can use acl - See https://help.ubuntu.com/community/FilePermissionsACLs

and

https://help.ubuntu.com/community/FilePermissions

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.