Enable screen/login lock again on Ubuntu 16.04

Some time ago my wife asked to use my laptop for a few hours. I know that the easier options was to use the guest profile but I don’t know why I decided to remove the password from my account. Well, I messed up everything.

The removal of the password disabled the screen lock and a few hours after that, when I tried to enable it again, it wouldn’t work. So I could enter the OS without any problem but Chrome, for example, would ask for the password.

I tried several approaches to bring back the screen lock and login lock but nothing would work. Neither the unity tweak tool nor the gsettings get org.gnome.desktop.lockdown disable-lock-screen command would help me. Finally I found the solution:

It was in THIS answer. I opened the /etc/group file and checked if the nopasswdlogin row would contain my username. And there it was. I just deleted the line and everything is back to normal.

Fucking hell …

You may also like...