0

I configured one of the PCs to act as a server. It will be used by other emloyees as well via the guest account. Obviously I don't want the PC to be shut down by any user. Also I have to shut it down before I leave every day. Is there a way by which I can confgure it to ask for username/password of an admin account whenever someone tries to shut down the PC?

I am running Ubuntu 14.04/Unity.

0

You can use Polkit rules to control the GUI shutdown privileges (the shutdown command isn't affected, and needs root as usual). A set of rules like in this answer should do. Create a .pkla file in /etc/polkit-1/localauthority/50-local.d/ (say 00-disable-shutdown.pkla):

[Disable Shutdown, etc. for all users]
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=auth_admin

The auth_admin policy will require that an administrative user (by default, members of the sudo group) authorize it.

  • Does not work, should I set any permissions? – daltonfury42 Jul 6 '15 at 12:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.