Hello! Halt on Linux is disabled for average user by default. It will try to request sudo/root password and if fails returns:

sasha@fedora:~$ systemctl halt
Call to Halt failed: Access denied

How can I make same behavior for poweroff action? I know it is possible somehow via PolicyKit rulle

  • BaalInvokerA
    link
    fedilink
    arrow-up
    6
    arrow-down
    1
    ·
    2 months ago

    What if you try another interface, like shutdown -P now or poweroff -p?

    • user_naa@lemmy.worldOP
      link
      fedilink
      arrow-up
      5
      ·
      edit-2
      2 months ago

      They all operates some way through systemd, so if operation is disabled via policy you cannot bypass it.

      sasha@fedora:~$ /sbin/halt
      Call to Halt failed: Interactive authentication required.