Ubuntu 16.04 Screen lock suddenly not working

17,075

Solution 1

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.

Solution 2

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

Solution 3

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

Solution 4

this solved my problem too; but now the clause has been changed in Unity Tweak Tool as shown below. It now says: ENHANCE SYSTEM SECURITY BY DISABLING:

So, make sure that everything is unchecked.

enter image description here

Solution 5

I had this problem after upgrading to Ubuntu 18.04. The keyboard shortcut Super-L did not work. The fix was to (re)install the missing package gnome-screensaver:

sudo apt install gnome-screensaver

For the OP with Ubuntu 16.04, (s)he might accidently have lost this package.

Share:
17,075

Related videos on Youtube

BathorySK
Author by

BathorySK

Updated on September 18, 2022

Comments

  • BathorySK
    BathorySK over 1 year

    I have two notebooks with Ubuntu 16.04.1/Unity 7.4.0 and few days ago the Lock screen stopped working on both machines. It worked before. The option to lock the screen has disappeared from the menu too. When I press Super+L, only black screen is shown, after mouse moving or any keyboard pressing desktop is back without prompting password.

    When I use dm-tool lock from terminal, it shows the Lock screen, but after pressing Ctrl+Alt+F7 I am back to the desktop (without being prompted for a password). I think this maybe started after some update.

    I use Ubuntu on my working notebook and I must protect the machine when I leave it.

  • ABS
    ABS over 6 years
    I was checked this checkbox suddenly(I mean it was checked) and when I read your answer, disabled it. Now I'm able to lock(just when it remain unchecked)!
  • adripanico
    adripanico over 3 years
    Wow! After two months I've finally found the right answer! @WinEunuuchs2Unix for president!
  • Majid Alaeinia
    Majid Alaeinia over 2 years
    Typing Lock Screen will show it on the launcher.