My dirty solution is to chmod +s /sbin/shutdown. It works but this is probably not good practice and insecure. Moreover after some system updates the suid bit gets reset. What would be the correct way to do it?

  • i usually do sudo shutdown now -h
    – kobaltz
    Jul 8 '12 at 20:12

All users? Or a selected subset of them? Will they use the computer locally or also remotely (e.g. via ssh).

In case of a few users who also work remotely sudo will work fine. See this link for details.

If they are logging in locally and via a GUI then there are better options. E.g. capturing the three finger salute via init and letting that trigger a 1 minute delayed shutdown. It has been ages since I set that up though, so I skipping on the details for that. (I used that back when Slackware 3 was modern)

  • Either a single user or a group such as %users. The idea is to avoid using sudo every time and entering passwords. According to the link you posted a line in sudoers like %users ALL=NOPASSWD:/sbin/shutdown is probably all I need. Thank you!
    – ccpizza
    Jul 8 '12 at 20:27

If your shutdown accepts the -a switch (check with shutdown --help), you can do the following:

  • Add the users that should be able to shut the system down to /etc/shutdown.allow.


  • Shut the system down using the -a switch.


    shutdown -a -h now

Source: UNIX man pages : shutdown (8)

  • looks like my version of shutdown (generic Linux of the -buntu family) does not support the -a option. Looks like the expected way is to create a %shutdown group which would include the users who need to shutdown and then reference that in the sudoers file.
    – ccpizza
    Jul 8 '12 at 20:32

I use SL 6.4. It has user version of poweroff, halt, reboot provided by usermode package. I can shutdown, reboot as a normal user (from the command line as well)

    $ which {poweroff,reboot,halt}

    rpm -qf $(which poweroff reboot halt)

As root

    # which {poweroff,reboot,halt}

    # rpm -qf $(which poweroff reboot halt)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.