S
S
sasha3002021-03-18 09:37:14
Access rights
sasha300, 2021-03-18 09:37:14

Why is the file being read with 110 rights to the directory?

I set 110 rights to the directory /var/www/html/
6052f29d7c51a538442069.jpeg
In the html directory there is a file info.php, with 440 rights
6052f3b412a1e005550047.jpeg
In the terminal I type "cat /var/www/html/info.php" and get the file displayed.
Why was the contents of the file displayed, in other words, the file was read, if for the directory I set the rights only to execute, and not to execute and read?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Rsa97, 2021-03-18
@sasha300

The x attribute on a directory allows access to files within it. The r
attribute on a file allows the file to be read. The attributes 110 and 440 you set allow the file to be read by root, the file's owner, and the group.

C
CityCat4, 2021-03-18
@CityCat4

If you sit as a root (or another user with id=0), then the rights system is ignored.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question