My goal is to be able to run a specific command without being asked for a password: /usr/sbin/efibootmgr -n 0000
(0000
is Windows).
The following process worked with no issue in my previous (ubuntu-based) system:
I edit a sudoers file with sudo visudo -f /etc/sudoers.d/bootWin
, enter the below and save it:
# Cmnd_Alias EFI_SET_WIN = /usr/sbin/efibootmgr -n 0000
# klairi ALL=(ALL) NOPASSWD: EFI_SET_WIN
I’ve done the same here, but it doesn’t seem to work. sudo -l -U klairi
doesn’t return anything relevant, and if I try sudo /usr/sbin/efibootmgr -n 0000
I’m asked for a password as normally.
(I’ve seen a past topic on the same subject: Sudoers NOPASSWD option not working but it seems that user’s issue was not including sudo
).
The syntax for the file seems to be OK (visudo didn’t complain either), and the main sudoers file does have #includedir /etc/sudoers.d
at the end. I can’t figure out what I’m missing (I’d bet it’s something silly).
Does anyone spot a mistake, or have any idea what else the issue might be?