How do I enable auto-login in LightDM?

I want user foo to auto-login using LightDM (which has been used by Ubuntu since version 11.10). How would I do that?


Solution 1:

An alternative to Alin's answer is to create a file /etc/lightdm/lightdm.conf and add the following content:

[SeatDefaults]
autologin-user=<YOUR USER>
autologin-user-timeout=0
user-session=ubuntu
# Uncomment the following, if running Unity
#greeter-session=unity-greeter

Next time you start, auto-login should work like expected.

Solution 2:

You can do this without editing configuration files: go to System Settings > User accounts, click "Unlock" and enter your password, then click the button next to "Automatic login":

'enter image description here