Allow users to shutdown

From ArchWiki
Revision as of 01:29, 24 July 2005 by Iphitus (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

If you want the user to have the ability to shutdown or reboot you have to change file permissions for the halt command. Reboot is a symlink to halt, so that doesn't need to be changed. Type as root:

chmod +s /sbin/halt

Topic: http://bbs.archlinux.org/viewtopic.php?t=2787


Another option is to do this using sudo. First install sudo:

# pacman -Sy sudo

Then, as root, add the following to the end of /etc/sudoers using the visudo command. Substitute user for your username and hostname for the machines hostname.

user hostname = NOPASSWD: /sbin/shutdown -h now
user hostname = NOPASSWD: /sbin/reboot

Now your user can shutdown with sudo shutdown -h now, and reboot with reboot.


A third option, under Gnome is to perform the following commands:

su
your password
chmod +s /sbin/halt
cd /var/run
mkdir console
cd console
touch username

This adds the "reboot" and "halt" options to Gnome's logout menu for the user defined.