/Etc/Sudoers File Does Not Have Any Effect

/Etc/Sudoers File Does Not Have Any Effect

I am having a problem on that whatever the contents of /etc/sudoers file I cannot elevate to sudo with anything, even with a password (wrong password - sorry, try again) though the password is correct.

Below are the contents from /etc/sudoers, which should be correct, unless in combination with other settings are broken. So, it must be something else.

FYI, I installed Puppet on my machine which in the beggining was controlling sudoers to my knowledge, but then I removed monitoring.

My normal privileges user is part of the adm group.

Defaults        mail_badpass
Defaults        secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"

root    ALL=(ALL:ALL) ALL

%adm ALL=(ALL) ALL
%sudo   ALL=(ALL:ALL) ALL

#includedir /etc/sudoers.d

Also, below is the output of /etc/sudoers.d folder and the contents of each file:

root@ns1:/home/vag# ls -la /etc/sudoers.d/
total 28
dr-xr-x---   2 root root  4096 Sep 22 23:46 .
drwxr-xr-x 151 root root 12288 Sep 23 19:19 ..
-r--r-----   1 root root    80 Sep 22 23:46 10_admins
-r--r-----   1 root root    90 Jun  4 20:06 60_mike
-r--r-----   1 root root    91 Jul 10 15:00 99-snapd.conf
root@ns1:/home/vag# cat /etc/sudoers.d/99-snapd.conf
 ##Allow snap-provided applications to work with sudo

Defaults    secure_path += /snap/bin
root@ns1:/home/vag# cat /etc/sudoers.d/60_mike
## This file is managed by Puppet; changes may be overwritten
mike ALL=(ALL)  NOPASSWD: ALL
root@ns1:/home/vag# cat /etc/sudoers.d/10_admins
## This file is managed by Puppet; changes may be overwritten
%adm ALL=(ALL) ALL

Can you help me to be able to use sudo again without having to "su root" every time?

Regards, Evang

8

1 Answer

I finally got around this by putting rules inside /etc/sudoers.d/ files.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Sarah Jenkins
Author

Sarah Jenkins

Sarah Jenkins is a veteran tech journalist with over 12 years of experience covering artificial intelligence, mobile innovations, and digital ethics. Her insights have appeared in leading technology publications worldwide.