Allow users to shutdown

From ArchWiki

Jump to: navigation, search
i18n
English
Italiano
Русский
Українська
Indonesia
简体中文

The first way: sudo

First install sudo:

# pacman -S 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 machine's hostname.

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

Now your user can shutdown with sudo shutdown -h now, and reboot with sudo reboot. Users wishing to power down a system can also use poweroff or halt.

The second way: Xfce

A third option under XFCE, if you don't want to use shutting down using Hal, is to install sudo. Then add the following line to /etc/sudoers using the visudo -f command.

  • For all users:
%users hostname=NOPASSWD:/usr/lib/xfce4/xfsm-shutdown-helper
  • For single user:
user hostname=NOPASSWD:/usr/lib/xfce4/xfsm-shutdown-helper

Substitute user for your username and hostname for the machine's hostname (you can use the hostname command to get it).

This activates the "reboot" and "turn off" options to XFCE's session-manager logout dialog for the user defined.

The Modern Way: PolicyKit

Start your X session by prepending ck-launch-session to your session-start line in ~/.xinitrc

exec ck-launch-session startxfce4
Personal tools