Every user or everyone it Guest Session can reboot computer. I want that Only root can reboot or power off computer. And about button of power off. Button must to be disabled. What I must do?
Asked
Active
Viewed 169 times
1 Answers
0
If you want to disable to the GUI shutdown/reboot options, use Polkit policies. Create a .pkla file in /etc/polkit-1/localauthority/50-local.d (say 00-disable-shutdown.pkla) containing:
[Disable Shutdown, etc.]
Identity=unix-user:*
Action=org.freedesktop.login1.reboot;org.freedesktop.login1.reboot-multiple-sessions;org.freedesktop.login1.power-off;org.freedesktop.login1.power-off-multiple-sessions;org.freedesktop.login1.suspend;org.freedesktop.login1.suspend-multiple-sessions;org.freedesktop.login1.hibernate;org.freedesktop.login1.hibernate-multiple-sessions
ResultAny=no
ResultInactive=no
ResultActive=no
You can add further sections which allow specific users or groups to use the buttons, or you can instead use unix-user:guest-* to specifically restrict guest users (whose names are usually guest- followed by a random string).
The button will still be present, but a shutdown/reboot option won't be:

See this bug.
muru
- 207,228