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 have a apache www folder, on Ubuntu machine. My current user 'joe' is the administrator. I added couple new users, but they can access www folder, how can I set permission to the folder, so a specific user can't access the folder (or he can read contents, but cannot open or modify any files)? Thanks!

share|improve this question

migrated from stackoverflow.com Nov 19 '11 at 18:29

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

1 Answer 1

up vote 1 down vote accepted

for example

find /www -type f -exec chmod 600 {} \;
find /www -type d -exec chmod 700 {} \;

chown -R joe /www 

But be aware: the apache must run as joe to have still access to this directories and files.

Or you have to create a special group, give the directory via chown to this new group, change the chmod's to 660 and 770 and put the user joe into this new group. And the apache-user should be in this group too.

share|improve this answer

Your Answer

 
discard

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