adding a sudoer in debian
As root edit /etc/sudoers and place the following line:
youruser ALL=(ALL) NOPASSWD:ALL
after
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
In this way you will be capable to execute all commands that require sudo privileges passwordless.
In order to use sudo and be prompted for a password you need to remove
NOPASSWD:ALL
Following command is correct and enough but you need to completely logout the user and relogin to work .
usermod -a -G sudo user
In addition, in Debian if it doesn't work you need to install sudo package:
apt install sudo
Then you should have /etc/sudoers
file and proceed as follows:
usermod -a -G sudo user