Allow users to shutdown

From ArchWiki
Revision as of 17:42, 19 February 2010 by Totalwormage (talk | contribs) (use i18n template)
Jump to navigation Jump to search

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.

Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어

External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

The first way: sudo

First install sudo:

# pacman -S sudo

Then, as root, add the following to the end of Template:Filename using the Template:Codeline command. Substitute Template:Codeline for your username and Template:Codeline for the machine's hostname.

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

Now your user can shutdown with Template:Codeline, and reboot with Template:Codeline. Users wishing to power down a system can also use Template:Codeline or Template:Codeline.

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 Template:Filename using the Template:Codeline 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 Template:Codeline for your username and Template:Codeline for the machine's hostname (you can use the Template:Codeline 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 Template:Codeline to your session-start line in ~/.xinitrc

exec ck-launch-session startxfce4