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.

These are the permission for my www folder:

drwxr-xr-x 18 root root  4096 Jul 16 00:21 www

Are they correct? I'm wondering: Why does it have to be an x (for execute) in there, isn't that risky? When I try to set them to remove the execute flag for others, my web server is not able to load any files anymore:

chmod o-x www

Am I doing it correctly or would I need to change something?

share|improve this question

migrated from stackoverflow.com Jul 15 '11 at 21:21

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

4 Answers 4

up vote 6 down vote accepted

On directories execute permission grants the ability to traverse the directory. A directory without x cannot be examined, which explains why the web server cannot see the files.

share|improve this answer

x on directory means that it can be accessed, and each file and folder in it can be "accessed" but the folder cannot be listed, i.e. you can't see it's content.

share|improve this answer

x for directories mean "permission to access the directory contens". Note that it is different from the r bit which grants the permission to view the contents. If you know the file path, you don't need the right to read its parent directory, but you need the right to traverse it (all parents of the file, actually).

share|improve this answer

For a directory, x means 'see the contents of the dir' not 'execute any files in that dir'. Only the x on a regular file means 'execute'. Isn't this one for the sysadmin board though?

share|improve this answer

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.