Reboot / Shutdown - Only allow root to

From Nocrashwiki

Disallow Normal User Reboot/Shutdown

Are your end users accidently on purpose rebooting/shuting down your machines? Here's how to fix that...

Disable reboot from Gnome/KDE (RHEL 4 and 5):

# gdmsetup (or maybe gdmconfig)
   uncheck show actions menu.


in /etc/inittab (near line 53)

Change:

   # Trap CTRL-ALT-DELETE
   ca::ctrlaltdel:/sbin/shutdown -t3 -r now

To:

   # Disallow CTRL-ALT-DELETE
   ca::ctrlaltdel:/bin/echo "ctrl-alt-delete has been disabled"

Trapping CTLR-ALT-DELETE has moved to /etc/init/control-alt-delete.conf in RHEL6

  Comment out #exec /sbin/shutdown -r now "Control-Alt-Delete pressed"
  Replace with: exec /bin/echo "Only Root is allowed to reboot this machine."

Rename some files

   #mv /etc/security/console.apps/poweroff /etc/security/console.apps/poweroff.disabled
   #mv /etc/security/console.apps/reboot /etc/security/console.apps/reboot.disabled

I also made a new reboot command in /usr/bin, the original is a symlink:

   /usr/bin/reboot -> consolehelper

This is what I did:

   mv /usr/bin/reboot /usr/bin/reboot.disabled
   # echo "/sbin/shutdown -r now" > /usr/bin/reboot
   # chmod 750 /usr/bin/reboot

As an added precaution, I replaced the above step with this command:

   #chmod 550 /sbin/reboot /sbin/shutdown

Enjoy!