Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running a competition as part of a class on web application development. I need to prevent one user group from accessing the other user group's work directory and vice versa.

I know I'll be preventing web access using a .htaccess file, and I'm fine on that front. I need to prevent permission access on the command line so that one group can't access the other group's directory. Seems like a simple chown and chmod thing, but I'm getting stuck.

My impression is that it should be something like:

chown -R :250a 250_A
chmod -R 707 250_A

but that allows world access, so the group can get into the directory. I just want to prevent one group (250b) from getting into the group.

share|improve this question

migrated from Sep 21 '09 at 19:08

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

Although, it'd be good to tag which platform you're talking about so it's clearer from the list... – Kev Sep 21 '09 at 19:35

Depending on your operating environment you might have Access Control Lists available (ACL's).

On RedHat Linux you could do something like:

setfacl -R -m g:redgroup:--- dirname

ACL's can give you much more granularity about who can see what.

share|improve this answer

It might be easier to simply change the permissions for the directory to 2770, and then add the account your web server runs under to the 250a group. That way you won't need to give permissions to other.

ls -al 250_A/
total 8
drwxrws---  2 250a 250a 4096 2009-09-21 12:18 .
drwxr-xr-x 93 root root 4096 2009-09-21 12:18 ..



Oh, just a little reminder. After you add the web service account to the group you'll probably need to restart the web server.

share|improve this answer
"add the account your web server runs under to the 250a group" And all the other groups. – wfaulk Sep 25 '09 at 2:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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