This happens during any sudo command which prompts for a password, apparently because of a problem in libpam-smbpass which is a Samba component for achieving the following:
This is a module for PAM that enables a system administrator to migrate
user passwords from the Unix password database to the SMB password
database as used by Samba, and to subsequently keep the two databases in
sync. Unlike other solutions, it does this without needing users to log
in to Samba using cleartext passwords, or requiring them to change their
existing passwords.
If you don’t require this capability, then a quick fix is:
# apt-get remove libpam-smbpass
(thanks)