This question already has an answer here:
Even when I am logged in as a non-admin user, when I enter
sudo bash or
sudo -s, the system does not ask for any password. In the command history, I have not entered any password for
sudo earlier (i.e.,
sudo did not cache any user credentials which might cause it to not ask for my password again in this session.)
Why is this strange behavior?
And how do I make sure that every
su command requires a corresponding password? And how to strictly ensure that any user cannot get root privileges without entering the root password?
Here is the content of my
# # This file MUST be edited with the 'visudo' command as root. # # Please consider adding local content in /etc/sudoers.d/ instead of # directly modifying this file. # # See the man page for details on how to write a sudoers file. # Defaults env_reset Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" # Host alias specification # User alias specification # Cmnd alias specification # User privilege specification root ALL=(ALL:ALL) ALL # Members of the admin group may gain root privileges %admin ALL=(ALL) ALL # Allow members of group sudo to execute any command %sudo ALL=(ALL:ALL) ALL # See sudoers(5) for more information on "#include" directives: #includedir /etc/sudoers.d ALL ALL=(ALL) NOPASSWD:ALL