2
I have a linux system with apache installed and i store web files in /home/username/www/sitename/htdocs. For this to work my /home/username has read and execute permissions for everyone. I know it's bad idea, but i'm the only user on the system so ... i don't really care and i wouldn't know how else to do it. But the fact is i need to create another user. The problem with that, obviously, is that the new user has access to old user's files. Is there any way i could only allow apaches www-data user and my own user to access /home/username? Here's what i've tried:
i created a group webusers
i added my username and www-data to webusers
i removed rx permissions for everyone on /home/username
rx permissions still remain for the group on /home/username
So shouldn't www-data be able to access /home/username now? It is in the same group as my user. Or is it not that simple? I've read there's primary and secondary groups but i didn't really get the point there ...
I see, but the other question still remains: if i chgrp htdocs, will apache be able to access it if the home directory itself wasn't chgrp'ed? – Marius – 2010-08-15T16:04:31.600
@Marius: if the parent directory has execute rights for Other, it will be able to access (seek) files in that directory. – Paused until further notice. – 2010-08-15T18:09:36.993