Difference between revisions of "Allow users to shutdown"

From ArchWiki
Jump to navigation Jump to search
m (use i18n template)
Line 1: Line 1:
[[Category:Security (English)]]
[[Category:Security (English)]]
[[Category:HOWTOs (English)]]
[[Category:HOWTOs (English)]]
{{i18n|Allow Users to Shutdown}}
{{i18n_entry|Italiano|Allow_users_to_shutdown (Italiano)}}
{{i18n_entry|Русский|Как разрешить пользователям выключать компьютер}}
{{i18n_entry|Українська|Як дозволити користувачу вимкнути комп'ютер}}
{{i18n_entry|简体中文|允许普通用户关机 (简体中文)}}
== The first way: sudo ==
== The first way: sudo ==

Revision as of 17:42, 19 February 2010

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