On Debian, sudo asks for user password by default. On Raspberry Pi OS, it doesn't.
How to configure sudo to ask for user password?
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It only takes a minute to sign up.Sign up to join this community
/etc/sudoers.d/010_pi-nopasswd and remove
NOPASSWD word from it.
Be careful if you edit it using a regular text editor: if you make a mistake, save the file and quit, you will end up with a broken
sudo and no way to edit the configuration again (which requires
Either don't close the editor until you have tested the new configuration, or have a
root session open in another terminal just in case, or use
visudo to edit the file (
visudo refuses to save files if there are syntax errors). You can also set a password for
root which lets you login as
root and recover your system.