Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 stackoverflow.com 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

2 Answers 2

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 ..

/etc/group

250a:x:112:250a,www-data

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

 
discard

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.