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 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 Nov 19 '11 at 18:29

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

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


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