How to disable poweroff/reboot to users?

Ralf Mardorf ralf.mardorf at alice-dsl.net
Sat Mar 18 09:08:35 CET 2017


Works on Arch Linux and I don't know a reason, why it shouldn't work on
Ubuntu, too:

[root at archlinux ~]# cat /etc/polkit-1/rules.d/10-admin-shutdown-reboot.rules 
polkit.addRule(function(action, subject) {
    if (action.id == "org.freedesktop.login1.power-off" ||
        action.id == "org.freedesktop.login1.power-off-ignore-inhibit" ||
        action.id == "org.freedesktop.login1.power-off-multiple-sessions" ||
        action.id == "org.freedesktop.login1.reboot" ||
        action.id == "org.freedesktop.login1.reboot-ignore-inhibit" ||
        action.id == "org.freedesktop.login1.reboot-multiple-sessions"
    ) {
        return polkit.Result.AUTH_SELF_KEEP;
    }
});

Regards,
Ralf


More information about the Xfce mailing list