Ubuntu – How to disable power off/restart option on lock screen

lock-screenpower-management

When I'm lock the screen it's possible to turn off computer or restart it. How to disable this possibility? This possibility on lock screen makes all lock screen idea no sense.

Best Answer

There are two related work around that may give you the desired result.

1: Create a file /etc/polkit-1/localauthority/50-local.d/whatever_name.pkla Copy the below given text in the file and reboot.

[Disable lightdm PowerMgmt]
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

Source: How to disable shutdown/reboot from lightdm in 14.04?

Also look for the mentioned uncomfortable comment in the link.

2: Change your lightdm display manager to GDM display manager.

Installation and switching is explained explicitly:

http://www.n00bsonubuntu.net/content/install-gdm-ubuntu-14-04/

After acitivating GDM follow the steps mentioned in the following link:

http://embraceubuntu.com/2006/03/20/disable-shutdown-for-normal-users/