How to disable automatic login in LightDM?

gksudo gedit /etc/lightdm/lightdm.conf 

It displays some text as follows:

[SeatDefaults]  
greeter-session=unity-greeter  
user-session=ubuntu  
autologin-user=username

Solution

  1. This <username> would be your particular user name that is automatically logged in with or without password. Delete this username and type in the administrative username or leave it blank.
  2. Shut down the system. It will go back to the login selection screen. Just power down the system and put it on again.

I had the same problem and it was solved by the command:

sudo gpasswd -d USER nopasswdlogin

where you should change USER by your user name.


System Setings

enter image description here

enter image description here

Disable Automatic Login


gksu gedit /etc/lightdm/lightdm.conf

You should see something similar to this:

[SeatDefaults]
autologin-guest=false 
autologin-user=username
autologin-user-timeout=0
autologin-session=lightdm-autologin
greeter-session=unity-greeter
user-session=ubuntu

Remove or put a # at the start of each line containing autologin and save/exit and reboot to test.


It's rare that @duffydack answer does not fit you... try this:

on a terminal do:

sudo vi /etc/gdm/custom.conf

or

sudo nano /etc/gdm/custom.conf

Your file should now look something like this:

[daemon]
AutomaticLoginEnable=false
AutomaticLogin=craig
TimedLoginEnable=false
TimedLogin=craig
TimedLoginDelay=10
DefaultSession=gnome-2d

edit AutomaticLoginEnable=true to AutomaticLoginEnable=false

that's other option.