Not actually my answer –
just reposting an answer that, sadly, has been deleted for unknown reasons.
Source: http://web.archive.org/web/20151014220049/https://superuser.com/questions/985661/shutdown-vs-shutdown-now-shutting-down-system-as-non-root
In Arch Linux, under certain circumstances, you may very well shutdown/reboot/hibernate... your pc without root privileges.
The Arch Linux Wiki page on Power Management under Systemd states:
polkit is necessary for power management as an unprivileged user. If you are in a local systemd-logind user session and no other session is active, the following commands will work without root privileges:
systemctl poweroff
systemctl reboot
systemctl suspend
systemctl hibernate
To check whether you are allowed to do this (i.e., you have polkit installed, and your session is not broken) you can use the following command:
$ loginctl show-session $XDG_SESSION_ID --property=Active
Active=yes
On other systemd
systems, like my Debian 8, this is not possible despite having the same reply to this command:
$ loginctl show-session $XDG_SESSION_ID --property=Active
Active=yes
$ systemctl reboot
==== AUTHENTICATING FOR org.freedesktop.login1.reboot ===
Authentication is required for rebooting the system.
Authenticating as: ,,, (myusername)
Password:
which indicates that polkit
has been set up by default in different ways on Arch Linux and Debian. The Arch Linux people see an advantage of this over sudo
, in that they state, in the wiki page on Polkit:
Polkit is used for controlling system-wide privileges. It provides an organized way for non-privileged processes to communicate with privileged ones. In contrast to systems such as sudo, it does not grant root permission to an entire process, but rather allows a finer level of control of centralized system policy.
As usual, YMMV.
As for shutdown now
, my guess is that it is a redirection to systemctl poweroff
, which is allowed to a non-privileged user.
-- https://superuser.com/users/255732/mariusmatutiae