Issue with sudo – sudo:auth could not identify password for [user]

If you get the following error when trying to execute a sudo command, despite the fact that you configured your sudoers or sudoers.d config file properly:

sudo: pam_unix(sudo:auth): conversation failed
sudo: pam_unix(sudo:auth): auth could not identify password for [user]

Then, you might need to have a look at the PAM configuration on your device.
Ensure that you have this line enabled in your /etc/pam.d/sudo file:

# cat /etc/pam.d/sudo
#%PAM-1.0
# The line below should fix the sudo:auth could not identify password
auth       sufficient   pam_permit.so

# The lines below are the default config
auth       include      system-auth
account    include      system-auth
password   include      system-auth
session    optional     pam_keyinit.so revoke

session    include      system-auth

Once you changed this file, no need to restart anything – just retry your command and it should work!