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.

2

1 Answer

Ok this was embarrassingly easy one... thanks @user3469811 for the tip, here it is:

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Maya Lin-Takahashi

Maya Lin-Takahashi

Consumer Tech & Gadget Reviewer

Maya is a hardware enthusiast who tests and reviews smart home devices, smartphones, wearables, and audio gear. She focuses on practical consumer value and build quality.

Share this article
Twitter Facebook Pinterest