3

I want to enable a user to run sudo without password. I used visudo to append the line to config file

idiot ALL=(ALL) NOPASSWD: ALL

Yet sudo still asks password as usual. Why?

5
  • 3
    Add the output of sudo -l.
    – muru
    Apr 20, 2017 at 9:41
  • 3
    because you have space between NOPASSWD: and ALL - change it to idiot ALL=(ALL) NOPASSWD:ALL and it should be fine
    – 13dimitar
    Apr 20, 2017 at 9:43
  • 1
    I have removed the space, but after sudo -k it still wants a password. Apr 20, 2017 at 9:46
  • 1
    is idiot a group or a user? If it's a group, the member of idiot must log out/login first. If it's a user - is idiot member of other groups, which require password for sudo?
    – 13dimitar
    Apr 20, 2017 at 9:50
  • Thanks, I have found the problem. It was /etc/sudoers.d folder not empty, it overrode my config. Thanks for sudo -l tip, it tipped me off. Apr 20, 2017 at 9:53

1 Answer 1

3

Problem solved. I assumed that the line

#includedir /etc/sudoers.d

Is commented out, because the symbol in the front. But no, it is still working and overriding my config. You should add your changes after the line or check the contents of /etc/sudoers.d directory.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .