E
E
Egorithm2020-11-15 01:23:24
linux
Egorithm, 2020-11-15 01:23:24

Where and how is it determined that the file must be run or edited only as root?

There are many files that are owned by root, but not all of them need to be run or edited with sudo. How is it configured? Is there any file?

I'm aware of /etc/sudoers. This is not it. There will be a start with sudo, but without a password. I mean running without/with sudo.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
Ronald McDonald, 2020-11-15
@Zoominger

Defined by permissions, specifically the x flag.
Some programs can be run as non-root users due to the SUID flag.

S
Saboteur, 2020-11-15
@saboteur_kiev

Each file has POSIX permissions, read about them.
Roughly - there are three rwx attributes, for three sets - the owner of the file, the group of the file and all other users.
Therefore
, rwxrwxr-x means that the owner and group have full rights, and everyone else can only read and execute.

V
Victor Taran, 2020-11-16
@shambler81

This is how the rights of the
group are set and the owner is responsible for where your user gets to, if he didn’t get into either one or the other, all the rest means 3 group (4 digit in the figure)
if only in the group then 2 (3 digit in the figure)
if this is the same user, then the first one. (2nd digit in the figure)
By adding the owner of the file and the group, you move it along rwx -> rwx -> rx, which consists of 3 identical parameters.
zj7pZlH.png
That's what they mean,
sec-sys2.png
however, these are standard rights, and there are also extended
ones such as SUID / SGID
And also there are also add-ons that allow, for example, only to append a file, not to allow saving the file in this directory, etc., but this is already exclusive and does not apply to the question.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question