I am trying to allow a user sudo access to NOPASSWD but something seems to be overridding the config? First invocation of sudo asks for a password.

Here is the output of the users sudo permissions and trying to run a command as another user through sudo.

Am I missing something here?

╭─   ~ ────────────────────────────────────────────────────────────────────────────────────── with baudneo@ZoneMinder at  12:35:25 PM
╰─❯ sudo -l -U  baudneo
Matching Defaults entries for baudneo on ZoneMinder:
    env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin, use_pty

User baudneo may run the following commands on ZoneMinder:
    (ALL : ALL) ALL

╭─   ~ ────────────────────────────────────────────────────────────────────────────────────── with baudneo@ZoneMinder at  12:36:28 PM
╰─❯ groups
baudneo sudo

╭─   ~ ────────────────────────────────────────────────────────────────────────────────────── with baudneo@ZoneMinder at  12:36:09 PM
╰─❯ sudo -u www-data zmml_eventproc -E -e 1263 -m 7 -D -C /etc/zm/client.yml
Sorry, user baudneo is not allowed to execute '/usr/local/bin/zmml_eventproc -E -e 1263 -m 7 -D -C /etc/zm/client.yml' as www-data on ZoneMinder.localdomain.

Edit: Ubuntu 22.04 LXC, I am trying to run a python script as the www-data user, my permissions and sudo config seem correct.

Edit 2: It was a full disk issue, after making space on the disk the command runs as www-data.

  • Please edit your question and i) tell us what operating system you are using and ii) explain what you want to do. It looks like you want to be able to run commands as another user, but you are only talking about the baudneo user here. Can you run sudo zmml_eventproc -E -e 1263 -m 7 -D -C /etc/zm/client.yml (without -u www-data)?
    – terdon
    Commented May 14, 2023 at 20:33
  • 2
    Please read this answer. sudo -l prints (ALL : ALL) ALL after (ALL : ALL) NOPASSWD: ALL and this explains why sudo asks for password. I'm not sure why user baudneo is not allowed to execute … though. I wonder if ZoneMinder vs ZoneMinder.localdomain has anything to do with it. Commented May 14, 2023 at 20:55
  • Add the Runas_Spec which shall allow the sudo -u www-data zmml_eventproc command to your question, including the Host_Alias. It seems that instead of ALL = you actually have a host defenition (ZoneMinder) but use the fqdn flag so that this has to be ZoneMinder.localdomain instead (or just remove the flag, if that does not cause other problems, of course). Commented May 14, 2023 at 21:31
  • not a dupplicate, but see my answer here : unix.stackexchange.com/questions/395776/…
    – Archemar
    Commented May 15, 2023 at 7:26

1 Answer 1


So, the disk was almost full. After making space all is well.

Very strange symptom for a full disk.

Thanks to everyone for their time!

You must log in to answer this question.

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