How do I prevent a non-root user from shutting down, rebooting, or halting the system?

Solution Unverified - Updated -

Issue

The steps to follow to prevent non-root users to shutdown/reboot/halt the server are:

  1. In the file /etc/X11/gdm/gdm.conf, change the line that reads:

    
        SystemMenu=true
     to
        SystemMenu=false
     
    

  2. In the file /etc/inittab, change the line that reads:

    
        ca::ctrlaltdel:/sbin/shutdown -t3 -r now
     to
        ca::ctrlaltdel:echo <A message indicating rebooting is not possible>
     
    

  3. In the directory /etc/security/console.apps/, remove the files: reboot, poweroff, and halt. To remove files, use the rm command. Example: rm /etc/security/console.apps/poweroff.

  4. Remove the file /usr/bin/poweroff

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.