You are not logged in.
I'm trying to make a sudoers.d file that allows me to run powertop without requesting sudo. This is the format of the file (written using visudo -f /etc/sudoers.d/powertop)
%wheel ALL=NOPASSWD: /usr/bin/powertop
This does not seem to work, despite the fact that visudo doesn't report any errors. If not syntax errors, is this some kind of semantic error? I'm not sure what's going on, any ideas?
EDIT: Just merged some of my files together, also using visudo. The %wheel perms to run ALL commands work, but nothing else, even after a logout-login. The third line is pulled pretty much straight from the wiki, only difference is that I chose to make it a wheel group option rather than just user specific, nothing besides the first entry seems to actually "work".
%wheel ALL=(ALL:ALL) ALL
%wheel ALL=NOPASSWD: /usr/bin/powertop
%wheel ALL=NOPASSWD: /usr/bin/systemctl poweroff, /usr/bin/systemctl halt, /usr/bin/systemctl reboot
Last edited by Frontear (2023-09-28 05:27:48)
Offline
that allows me to run powertop without requesting sudo
Just to be sure: you're trying to "sudo /usr/bin/powertop" but it's still asking for a password?
In that case
sudo -l
id
Otherwise, sudoers doesn't add a suid (process implicitly runs as root) and that's also not a good idea.
Offline
$ sudo -l
User frontear may run the following commands on frontear-net:
(ALL : ALL) ALL
(root) NOPASSWD: /usr/bin/powertop
(root) NOPASSWD: /usr/bin/systemctl poweroff, /usr/bin/systemctl halt, /usr/bin/systemctl reboot
$ id
uid=1000(frontear) gid=1000(frontear) groups=1000(frontear),998(wheel)
Everything looks fine?
Offline
Yes, does
sudo /usr/bin/powertop
still ask you for a password?
Offline
Yes, does
sudo /usr/bin/powertop
still ask you for a password?
Remade the files after rm, and it works as prescribed. I'm gonna chalk it up to either some perm or other weird quirk, I know sudo is quite temperamental
Offline