[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: security problem ?



On Mon, 26 Mar 2001, souleymane kante wrote:
> Everybody has read permission on all the directories and files, but
> only root can see the directory content with the LS command. I don't
> undrstand what happen.

To read a normal file, you need read permission for the file itself,
execute permission for the directory that contains the file, and
execute permission for all the other directories between the directory
of interest and either your current directory or the root directory
(depending on whether you use and absolute or relative directory name).

The "ls" command needs to read the directory (treating the directory
itself almost like a file that needs to be read), so it needs read
permission for the directory itself, and execute permission for all the
other directories between the directory of interest and either the root
directory or your current working directory.

In other words, when you are considering permissions on a directory, "r"
is permission to read the directory itself (to find out the names of any
files or subdirectories inside this directory, as the ls command does),
"w" is permission to write to the directory itself (to create, delete or
rename files or subdirectories), and "x" is permission to go through the
directory to get to a file or a subdirectory inside it (assuming that
you already know the name of the desired file or subdirectory).

--apb (Alan Barrett)