Ubuntu 16.04 Screen lock suddenly not working

You don't need to install 3rd party package

You can re-enable lock screen directly from the terminal.

To see if Lock screen is disabled:

gsettings get org.gnome.desktop.lockdown disable-lock-screen
false

If result is true then use:

gsettings set org.gnome.desktop.lockdown disable-lock-screen false

I solved my problem as follows (I found solution in another question):

  • Install "Unity Tweak Tool" with sudo apt install unity-tweak-tool

  • I ran it from the Launcher and select System > Security > Enhance system security - Enable Desktop lock.

I don't know what disabled this option. but now it is working OK.


I agree with @WinEunuuchs2Unix, you should not need to install 3rd party software to resolve this issue. This issue recently happened to me after upgrading software on my work machine.

I first attempted

gsettings get org.gnome.desktop.lockdown disable-lock-screen

which returned false so I knew that wasn't the issue. Next, I checked the nopasswdlogin line in /etc/group file and saw that my username was added to this. I removed my login name and saved the file. This solved my lock screen problem.

Here is a reference on how to read this file: Understanding /etc/group File