I'm experimenting around with Debian and I'm wondering about their permissions concerning systemd and reboot. I made the following obersvations (Debian Buster with lightdm and i3 WM):
- The commands
poweroff
etc. map to/sbin/poweroff
which is a link to/bin/systemctl
/bin/systemctl
has permissions-r-s------
and is inaccessible to the user- As a result,
systemctl poweroff
etc. will not work, not evensystemctl --user mycommand
will not work (unlike e.g. on Arch Linux).
However when I install KDE, I can poweroff and reboot from the menu without entering a password! I didn't find any useful answers online and I don't understand how this is possible. How do they achieve that?
polkit
like other DEs, please check here. In short: the GUI user is explicitly given the permission to perform these tasks. – FelixJN May 27 '19 at 12:27