A
A
Asparagales2020-11-25 13:25:32
linux
Asparagales, 2020-11-25 13:25:32

Why do I have access to directories and files when I shouldn't?

I created a directory, created a file inside it, then ran the command:
chmod -R 000 /имя_каталога
The ls command for the directory has the following output:
d--------- user_name users
and for the file:
---------- user_name users
It seems like when I logged in as user_name, I can’t do anything with this directory and file, but as root - everything. But for some reason, as user_name I can rename the directory, but as root I can't create a new file in it.

On another drive there is a directory with files that also do not have any permissions, only the user and user group for them root. However, as root I can rename the directory, open it, open and rename files inside, but for some reason I can't create new ones.
In general, I can not understand how it works or why it does not work. (FS ext4).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
galaxy, 2020-11-25
@galaxy

But somehow as user_name I can rename the directory
Renaming a directory requires write access to the parent directory.
and as root I can not create a new file in it
and this is strange. I tested it myself, root can do everything

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question