Remove Shutdown/Restart button from login screen and from session also

We have installed Rocky 9.3 on labs computer. I would like to remove the reboot/shutdown/suspend options from the login screen and also from the screen when the user’s logged in.

I have created /etc/dconf/db/local.d/00-security-settings with the following content :
[org/gnome/settings-daemon/peripherals/smartcard]
disable-restart-buttons=‘true’

I have also created the /etc/polkit-1/rules.d/100-stop-reboot.rules file with
polkit.addRule(function(action, subject) {
if (action.id == “org.freedesktop.login1.power-off” ||
action.id == “org.freedesktop.login1.power-off-multiple-sessions” ||
action.id == “org.freedesktop.login1.reboot” ||
action.id == “org.freedesktop.login1.reboot-multiple-sessions” ||
action.id == “org.freedesktop.login1.inhibit-block-shutdown” ||
action.id == “org.freedesktop.login1.inhibit-delay-shutdown” ||
action.id == “org.freedesktop.login1.suspend” ||
action.id == “org.freedesktop.login1.suspend-multiple-sessions” ||
action.id == “org.freedesktop.login1.suspend-ignore-inhibit” ||
action.id == “org.freedesktop.login1.hibernate” ||
action.id == “org.freedesktop.login1.hibernate-multiple-sessions”)
{
return polkit.Result.NO;
}
} )

but options are still available.
What am I missing? Can anyone please help me? :laughing:

Best regards

Maria

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.