Ubuntu – How to disable automatic login in LightDM

lightdm

I was playing around with "User accounts" and somehow set automatic login. Now, when I start my PC, it just has one button named as "login". Clicking that button, directly logs me in to my PC.

There is no music or no asking for password while logging in. As a side effect, it asks me separately for keyring password

How to disable auto login and make login/keyring password unified again like before?

NOTE: Attempting to disable Automatic Login from System Settings > User Accounts does not work.

This is the content of my /etc/lightdm/lightdm.conf (where I have commented the autologin for my username mgandhi):

[SeatDefaults]
greeter-session=unity-greeter
user-session=ubuntu
#autologin-user=mgandhi

Best Answer

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.