No password prompt at sudo command

Solution 1:

Edit /etc/sudoers using sudo visudo, and remove the last line:

ALL ALL=(ALL) NOPASSWD:ALL

(By the way, please note that this line at the end of the file is not the preferred way to make sudo not prompt for a password, for those who want to do that.)

Solution 2:

Use this command to find the source of the problem:

sudo grep -HRn NOPASSWD /etc/sudoers.d/

In my case:

/etc/sudoers.d/50_stack_sh:1:username ALL=(root) NOPASSWD:ALL

comment the line with # and close your terminal.