So I've tried looking this up but I've not found similar examples (please feel free to refer to them if your Google skills are better than mine).

What I'm trying to do is as follows: I am hosting a website on my own machine, and its contents are located at /var/www. I've made 'jordan' the owner of that group using 'chown' and I have no problems making, creating, editing files within that subdirectory as user 'jordan'. Within this directory, I have created a folder called 'recipes' and a user called 'recipe'. The problem is that 'recipe' cannot chmod any of the files in this directory. Additionally, as 'jordan', I cannot edit any of the files in the 'recipes' directory.

Is there a way to make both 'jordan' and 'recipe' belong to the same group which has chmod privileges for that folder and will allow 'jordan' to edit/write files?

migrated from stackoverflow.com Mar 2 '11 at 16:35

This question came from our site for professional and enthusiast programmers.


If your mounted file system supports access control lists (acl's) then you could use those. see man setfacl. That allows for quite fine-grained setting of permissions. e.g.

setfacl -m u:username:rwx file

to give read,write,execute to username on file. Even though the file still has one owner, lots of individual users can have access. And

getfacl file

to see a list of set permissions.

See: http://fedoraproject.org/wiki/Docs/Drafts/AGBeta/ACLs for what looks like a good guide to enabling and using.

One warning though, beware of what backup utilities you use, they don't all support these acls

Or, probably simpler... you could add users to a group which owns the entire tree... 'www-data' being a good example. Not quite as fine grained though. You'll want to check out 'man usermod' but it'll be something like usermod -aG group user

  • Will check it out, thanks for the input! – JDelonge Mar 2 '11 at 17:12
  • rsync supports ACLs. For programs that don't, there is setfacl --restore. – grawity Mar 2 '11 at 20:29

You may want to take a look at


A good tutorial on how to allow multiple users to edit shared files through the use of groups.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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