As a security measure, the capability to reboot and shutdown is provided exclusively for root. The recommended way to perform each act is listed top to bottom (only need to use one).
poweroff shutdown -h now halt
shutdown -r now reboot
There are instances where you may want to have this capability extended to new, unprivileged users, in order to not have to provide root credentials, or 'sudo' power. The following commands will allow users of group games perform a reboot or a poweroff in addition to the root user.
chgrp games /sbin/halt
chmod 710 /sbin/haltchmod u+s /sbin/halt
This effectively says:
- Make 'halt' owned by group games
- Let only the owner (root) and the group games execute this command
- Let all requests (by either root or games) act as if executed by the owner (root)
Thus, when root or any games member executes reboot or poweroff, it is has the privileges of root and executes properly.
This is in contrast to the default configuration:
- halt is executable by ALL users (777)
- The 'halt' binary checks the effective UID for '0' (root).
- If root, honor request.
- If other, deny request and return 'must be superuser'