[CentOS] How to restrict reboot/poweroff from non-admins?
Philip.R.Schaffner at NASA.gov
Wed Mar 28 10:03:15 EDT 2012
Timo Neuvonen wrote on 03/28/2012 09:17 AM:
> I just noticed that CentOS (6.2) by default allows any user to
> reboot/poweroff system without any admin rights, or without any further
> questions, if using commands 'reboot' or 'poweroff'. But 'shutdown' still
> requires admin rights.
> What is the preferred way to restrict any regular user from rebooting /
> powering off the system (by accident)?
> IMHO, sudo should be required for this purpose (at least in a system with
> shared remote access from multiple users, single-user laptops etc may be a
> different case)
OUCH! This seems to qualify as a CentOS bug. I confirm that a normal
user can reboot or poweroff the system on 6.2. On RHEL:
$ rpm -qa redhat-release\*
poweroff: Need to be root
reboot: Need to be root
More information about the CentOS