0

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 even systemctl --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?

Kalsan
  • 173
  • 1
    KDE uses 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

1 Answers1

0

There is a mechanism called "polkit" that is used to (among other things) allow the user logged into the machine locally to perform certain tasks that on a traditional unix system would require root, such as shutting the machine down, connecting to networks etc.

There is a more in-depth answer at How does gnome reboot without root privileges? , ignore the talk of gnome in the question, this mechanism is used across many different desktops.

plugwash
  • 4,352