Search code examples
debiansudosudoers

sudo command not working despite sudoers file


I'm trying to use sudo command in Debian 9. For example sudo apt install zsh will ask the root password but does not accept it. I do indeed know the root password (I'm the only user of this machine) and I have added my 'meouser' to the sudo group.

root:~# cat /etc/group | grep sudo
sudo:x:27:meouser

I have edited /etc/sudoers with visudo and it has lines (should I show more of it?)

root:~# cat /etc/sudoers | grep -w sudo
# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL

But this is what happens:

meouser:~$ sudo apt install zsh

We trust you have (...etc removed the usual warning...)

[sudo] password for meouser: 
Sorry, try again.
[sudo] password for meouser: 
Sorry, try again.
[sudo] password for meouser: 
sudo: 3 incorrect password attempts

I have tried this several times, the problem is no way mistyping the password gazillion times. What I'm doing wrong? Advice appreciated. I have of course searched SOF but have not found this situation; in particular I have no problem with accessing the /etc/sudoers file itself.


Solution

  • Ok this was embarrassingly easy one... thanks @user3469811 for the tip, here it is: https://unix.stackexchange.com/a/170894

    As it turns out, I was stubbornly inputting the root password, not meouser's. (My mind was stuck on following the su - procedure.) On hindsight, it does request "password for meouser". Ah well once again I'm saved by the community.