Answer the question
In order to leave comments, you need to log in
Why does sudo ask for a password from the user and not from root?
I installed Linux (Ubuntu), created one user there during installation,
then manually change the root password, sudo passwd root
now when I use the su command, I ask for the root password,
and when I use the sudo command
, it asks for the user password
UPD: on the contrary, I need to lower the user's rights (deny access to editing system files, installing applications, etc.)
Answer the question
In order to leave comments, you need to log in
man sudo
before understanding
the sudo command and is intended to not give the user the root password, but still allow some operations to be performed as root.
PS. The fact that everyone usually does "sudo su - " is already the second question). By the way, yes, I recommend studying the difference between
"sudo su" and "sudo su -"
if you ask for the root password, why then sudo? After all, this is one of the ways to
hide the root password or disable it altogether)
in general, the sudo (su-du) command can issue limited rights, not full ones, for example, to execute only certain programs "as root". Or to execute certain programs with certain files.
That is, it is not a direct replacement for root
ieh and I'll write my five capes :)
replacing the root password with the user password specifically so as not to shine with the root password.
sudo is a very clever command for granting different levels of rights to users.
access rules are determined by the config.
for example, in this case, you are granted superuser rights because you are a member of the sudo group and there is such an entry in the config
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question