Require password to execute sudo commands?

Hi,

Currently, I’m using my DietPi as a non-root user that has sudo privileges. I’ve disabled the root-account over SSH.
When I connect to DietPi, I can execute sudo commands without ever needing to provide a password.

I’d prefer if I’d at least have to input the password once, when I login while trying to execute the first sudo command, and again after a certain time of inactivity has passed.

I’ve chnaged the first line of /etc/sudoers to accomplish this:

Defaults    env_reset, timestamp_timeout=120, pwfeedback

I’ve added timestamp_timeout and pwfeedback, however nothing really changed after rebooting.

Any ideas?

There is another config for the user dietpi in the file /etc/sudoers.d/dietpi which is set to NOPASSWD: ALL:

dietpi ALL=(ALL:ALL) NOPASSWD: ALL

Removing the NOPASSWD tag should solve this: dietpi ALL=(ALL:ALL) ALL.

2 Likes

Now it works. Thank you!