PDA

View Full Version : How can I disable the lock screen option for every user?



gad-maor
November 27th, 2014, 11:38 AM
I have several machines running ubuntu 14.04 LTS and there are a lot of users that log in and out of them (not local users). I wish to prevent any possibility of a user locking the screen in a computer (thus leaving it unusable for other users). I tried to do it via gsettings, but it only applies to the gnome-session of the specific user from which the command was run.

Is there a way to do this with a script(sh) in the root directory, or by removing (uninstalling) the lock screen option completely from an ubuntu machine?

BTW, the display manager used is lightdm.

CantankRus
November 28th, 2014, 01:11 PM
This should work to run the dconf command at every users login.
Create a global autostart file.

gksudo gedit /etc/xdg/autostart/disable-lock-screen.desktop
Copy and paste in the following...

[Desktop Entry]
Type=Application
Exec=gsettings set org.gnome.desktop.lockdown disable-lock-screen true
Hidden=false
NoDisplay=true
X-GNOME-Autostart-enabled=true
Name=LockScreen Disabled
Comment=Disable the lock screen

The NoDisplay=true line will make it not show up in each users startup applications.

CantankRus
November 28th, 2014, 07:58 PM
Ok this is probably the right way to do it.
When Ubuntu used gconf you used to be able to set keys as mandatory.

Using this guide (https://wiki.gnome.org/Projects/dconf/SystemAdministrators) I was able to disable-screenlocking for all users.

I've attached the files I created. You can use the included ReadMe.txt file to manually install
or
Extract the archive and run the install.sh script in terminal to install the files.

The process can be reversed by running the un-install.sh script in terminal.