I just observed something strange.
Logged into an archlinux system as a non-privileged user, I executed shutdown
. As expected, it returned Must be root.
To my surprise, executing shutdown now
it (apparently!) does not check if the current user has root privileges. It simply shuts down the machine.
I tried reproduced this both in a tty and a terminal in the Plasma DE.
I'm running Archlinux with an 4.2.2 Kernel with current packages.
I don't think this is related with GUI policies.
tl;dr: shutting down system as non-root with shutdown now
Best Answer
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:
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:
On other
systemd
systems, like my Debian 8, this is not possible despite having the same reply to this command: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 oversudo
, in that they state, in the wiki page on Polkit:As usual, YMMV.
As for
shutdown now
, my guess is that it is a redirection tosystemctl poweroff
, which is allowed to a non-privileged user.-- https://superuser.com/users/255732/mariusmatutiae