1

I have setup Ubuntu as a development web server - however I am experiencing problems with file permissions. I have 2 users, user1 and user2, and they both have been put into the group www-data.

I have uploaded a new file with user1 so the file is owned by user1 and the www-data group.

At present if user2 wants to modify the permissions on that file to say 777 - they cannot.

Is there a way to allow any users within a group to be able to modifiy permissions etc.. on this file? I have tried changing umask to 002 and a few other combinations that were suggested without luck.

0

1 Answer 1

2

From chmod(2) --

   The effective UID of the calling process must match the  owner  of  the
   file,  or  the  process  must  be  privileged  (Linux: it must have the
   CAP_FOWNER capability).

However, user2 (with write permissions on the directory) could create a copy of the file, set its permissions, then replace the original file with the copy.

3
  • Wouldn't ACLs also work for this?
    – Marcin Gil
    Nov 18, 2009 at 7:15
  • @Marcin - I don't think so. Can you figure it out? See linux.about.com/library/cmd/blcmdl1_setfacl.htm#lbAG
    – NVRAM
    Nov 19, 2009 at 19:43
  • By Cameron: In response to your answer: They can modify the file but they cannot modify the permissions. Say for example I upload a directory and it is set to 755 and it owned by user1. user2 is not able to change that directories permissions to 777 - only user1 is able to. I would want any user who is in the same user group to be able to modify a files permissions.
    – Ivo Flipse
    Mar 16, 2010 at 8:19

You must log in to answer this question.