shared folder between multiple users

eknip

Verified User
Joined
Jul 29, 2009
Messages
21
Hi all,

I'm running PHP in CGI mode and want to make /lib/shared_folder/ accessible for multiple users.

I tried to chown the folder with apache:apache, but without any luck (probably because all users got their own username:username rights).

Can anybody tell me how I can access the shared folder from multiple accounts?

Thanks!
 
What OS are you running? RedHat, CentOS and Fedora automatically create a group for each user. So to create a shared sub-directory (while some desktop systems use the term folder, on servers we generally use the term sub-directory) you'd give it all the rights it needed for a group (for example, instead of 755 use 775), make sure it's owned by username:username (where the second username refers to using the same name as the groupname), and then in the /etc/group directory add users to the group (see man group for documentation).

Important note: if someone else (perhaps an automated provisioning system) is adding or deleting users while you're editing it, you could write back a file that overrides those changes. To prevent that from occurring, what I do is remove write access to the file while working on it; then I add it back later.

Jeff
 
Back
Top