Question

How to find all files in non readable directory

For example directory /home is locked perm 40700

But I can read all files in this directory like /home/index.php and etc

How to list all files in this directory?

I tryed ls and find function do not want to find thoose files

Was it helpful?

Solution

The r permission of folders determines whether you can list the contents. If a folder has x but not r, then you can access files as long as you know their names.

An example for this is to allow users to publish HTML documents in their home folders. For this, set the permissions for /home/user to rwx-----x and /home/user/public_html to rwx---r-x

That way, the HTML server can access the folder (it can walk though your home folder) but it can't see any files outside of the public_html folder.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top