If you just need to give the power to reboot to non-admin users, you can add an entry for them in your sudoers
file for reboot
(and/or systemctl reboot
, depending what you want them to run). Then they will be able to run sudo reboot
(and/or sudo systemctl reboot
). This answer assumes that they do not otherwise have access to sudo
— i.e., that they are normal, non-admin users that are not part of the wheel
group.
The sudoers
file lives at /etc/sudoers
, but you should not edit it directly. Rather, you should only edit it using visudo
. You'll need to be root to edit it, so you'll run sudo visudo
. The visudo
command will verify the syntax of your edits, and you should always use this to avoid breaking your config and preventing yourself gaining root access in the future.
Then you can add the something like following lines to your sudoers
file:
username ALL=(root): /usr/sbin/reboot
username ALL=(root): /usr/bin/systemctl reboot
where username
is the user's username (or %groupname
for a group), and where the paths are the actual paths to the commands on your system (check with which
, e.g., which reboot
.).
For more information, check out man sudoers
, man sudo
, and man visudo
.