If I have a folder specified as not-readable. Are all folders under it also non-readable? For example, my shared hosting home account directory is not accessible to other accounts, so, are all folders and files that are 0777 under that home account directory non-accessible, too?
Filesystem permissions on Unix
filesystemspermissionsunix
Best Answer
Directories have two different read permissions. You have the standard read permission, like you do with files. This stops you from doing an opendir()/readdir() on the directory. This basically stops you from doing an ls in the directory. You can still access subdirectories if you know the name of them. You also have the execute permission, which in the case of directories prevents you from accessing the files inside them. You can not change directory to a directory you don't have execute permission for and you can not access anything under it, but you can still read the contents.
You'll notice that the
ls execute
displays an error and the subdirectory. The reason is that ls is allowed to read the execute directory and discover the subdirectory, but ls will stat the subdirectory and get a permission denied there.