in reply to More Directory Permissions
The x bit is probably the most interesting to the person who posed this question: this bit being on allows (and is necessary for) two things: "cd"'ing to the directory, and moving though the directory to access files and subdirectories. If you have x but not r, you can't read the directory but if you know a file/subdirectory is there, you can operate on that file/subdirectory according to your permissions on that item. Conversely, if you have r but not x, you can see the item but can't do anything to it: ls will show it exists, but ls -l will fail on trying to give you any of the attributes of it, it can't go through the directory to get at the file and find its attributes.
x without r, or r without x, is generally not too useful; so directory permissions tend to be (numerically) 7s or 5s where access is desired (depending on whether write is on or not). Having just x on isn't much of a security hole, since it doesn't provide any information, and one still needs still needs permissions granted on the subitems to do anything with them, so frequently one will just leave x on (1 numerically). So directory permissions will tend to be all-odd (751, 711, etc.), while non-executable files are all even (644, 640, etc.) (since you don't want to have your letter to your mother treated as an executable shell script).
|
|---|