Sudo/doas stopped working

Hi friends,

I seem to have lost permission to run something as root and I am kind of baffled how this could have happened. I use doas and have it configured as per the Archwiki setup including the opendoas-sudo aur package to manage the symlink. It has been working fine up until this morning and I have not updated my system or done any other modifications which could explain it.

[root@main alex]# cat /etc/doas.conf

permit :wheel
permit nopass :wheel as root cmd /usr/bin/smartctl
permit persist :wheel

[root@main alex]# ls -l /etc/doas.conf
-r-------- 1 root root 89 Aug 24 13:26 /etc/doas.conf
[root@main alex]# groups alex
wheel alex

I’m not sure what else I could check?

Did you check if the config file is okay?

Isn’t that information all in the first post above?

Is there anything in the logs showing authentication failures?

Could you be a bit more specific. Where do I look for logs?

Start with journalctl. One easy way is to use journalctl -f and then try to run doas in a different terminal.

If that doesn’t show anything, see if doas itself does any logging.

Nothing new. Shows: Aug 24 14:43:09 main doas[21502]: command not permitted for alex: paru -Syu

Can you run this?

doas -C /etc/doas.conf && echo "config ok" || echo "config error" 

Also check this note:

Note: The configuration file must end with a newline.

  • Config is fine. Returns ok. Hasn’t been altered since it last worked.
  • As you can see in the posted config above it does end with a new line. Thanks though.