[CentOS] directory permissions set to 600?

Wed Jul 21 02:36:17 UTC 2010
Gordon Messmer <yinyang at eburg.com>

On 07/20/2010 05:17 PM, Robert Heller wrote:
>> um... on a directory, the X bit means you can LS the contents of the
>> directory.   of course, root ignores this anyways and overrides it.
> Note that execute access is only needed on a directory if you want to
> list its contents (eg ls).  If you know ahead of time the name of the
> file in the directory you seek to access, you don't need execute access
> on the directory.

You and John are both incorrect.  Read access is sufficient to get a 
list of files and directories in a given directory.  The execute bit on 
a directory is required to access the directory's contents.  If a 
directory is 'rw-' for a user (other than root), the user can get a list 
of its contents using 'ls'.  However, since the contents are not 
available, the user cannot stat() the names to determine what type of 
file they are, their size, their owner/group, etc.  The user will also 
not be able to chdir to a sub-directory without execute access.

The fact that Doug has a directory with octal mode 0600 is probably an 
oversight which goes unnoticed because the root user gets the privilege 
of lax security checks.