Hello! Halt on Linux is disabled for average user by default. It will try to request sudo/root password and if fails returns:
sasha@fedora:~$ systemctl halt
Call to Halt failed: Access denied
How can I make same behavior for poweroff action? I know it is possible somehow via PolicyKit rulle
You must log in or register to comment.
Edit the sudoers file.
## user is allowed to execute halt and reboot whateverusername ALL=NOPASSWD: /sbin/halt, sbin/reboot, /sbin/poweroff
What about
systemctl poweroff
?