%users ALL = (ALL) NOPASSWD: /sbin/shutdown -p now
%users ALL = (ALL) NOPASSWD: /sbin/shutdown -r now
$ sudo sbin/shutdown -p now
or $ sudo sbin/shutdown -r now
Easily explained:But reboot give permission denied error
peter@unicron:/home/peter $ ls -l /sbin/shutdown
-r-sr-xr-- 2 root operator 17288 Mar 25 11:27 /sbin/shutdown*
peter@unicron:/home/peter $ ls -l /sbin/reboot
-r-xr-xr-x 4 root wheel 11008 Mar 25 11:27 /sbin/reboot*
# chmod 4554 /sbin/reboot && chgrp operator /sbin/reboot
but I'm not too sure if that's a good idea. If other processes not owned by root rely on reboot then you could easily break things.I have a user that belongs to operator group on a FreeBSD 11.1 installation, the user is able to shutdown the system with:
Code:% shutdown -p now
But reboot give permission denied error
Code:% reboot reboot: Operation not permitted
shutdown -r now
?