0

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?

0

2 Answers 2

3

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

1
0

You may want to take a look at

http://hep.pa.msu.edu/user/groups.html

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

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .