Pihole commands without sudo on ubuntu

I want to run Pihole commands without authenticate as sudo (e.g. pihole -up) on Ubuntu 18.04.4 LTS.

I already tried to edit the sudoers file and added the following line at the very end of the file:

dominik ALL=NOPASSWD: /usr/local/bin/pihole

I connect via ssh to the ubuntu machine and rund the command pihole -c -e but the system asks for sudo password.

Why?

Take a look at password - Adding NOPASSWD in /etc/sudoers doesn't work - Ask Ubuntu

Thanks for the tipp, I already read and tried dozens of solutions I found on the web, but this thread also don't works.
What works is the line:

dominik ALL=NOPASSWD: ALL

But this allows the user to run all sudo commands without password prompt - not what I want.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.