Automatic screen lock not working Ubuntu 20.04

From Settings -> Privacy, I got

  • Automatic Screen lock -> turned on
  • Lock Screen on Suspend -> turned on

None of them locks my screen. But the manual lock option works fine. (I did get some error message about Auto-lock while installation)

Any thoughts on how to fix it? And I'm using lightdm instead of gnome-gdm3


Screen lock is disabled by default with lightdm on Ubuntu 18+ due security issues.

check more here:

  • SO original question
  • Bug on launchpad #1
  • Bug on launchpad #2
  • or just try yourself: lock screen, press CTRL+ALT+F7 and you will be back on your desktop without providing a password

You can check you display manager with: sudo systemctl status display-manager

If you still want to lock your screen with lightdm - you can use dm-tool lock. Also you can add it to keyboard shortcut as command (e.g. Super+L).

Switching to gdm3 helped: sudo dpkg-reconfigure gdm3


What's the timeout set to? Previous experience may point to a very unexpected hardware related cause which I call "mouse jitter": It could be that your mouse has a slight malfunction and 'jiggles' by itself a bit, causing your computer to stay awake. Try unplugging your mouse and see what gives.