Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

share|improve this question
1  
FYI, If you are using home folder encryption, you can't enable auto login. –  Saeid Zebardast Mar 30 '13 at 8:37

9 Answers 9

up vote 32 down vote accepted

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

share|improve this answer
    
I'm working on Ubuntu 14.04. Here there is no option as "Automatic Login" as shown in your screen shot. Please say how to enable automatic login. –  Ravi Sep 25 at 6:48
    
@Ravi: the option is still there in Ubuntu 14.04 and 14.10. But there's an alternative answer below for enabling this from the lightdm.conf file. –  Alin Andrei Sep 26 at 11:40

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
greeter-session=unity-greeter

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

share|improve this answer
1  
Setting autologin-user to your user name is enough for autologin to work. –  Smile4ever Oct 22 at 16:47

You can easily do this with lightdm-set-defaults if you'd rather not edit lightdm.conf manually:

sudo /usr/lib/lightdm/lightdm-set-defaults --autologin username

It will not set the autologin timeout, but the default for that is 0 in the code anyway, so you don't need to set it.

share|improve this answer
    
Copy pasters: sudo /usr/lib/lightdm/lightdm-set-defaults --autologin "$USER" –  Ciro Santilli Feb 10 at 7:34
2  
This doesn't work in 14.04 LTS as lightdm-set-defaults was removed then so the other methods are better. –  Robert Ancell Aug 22 at 7:33

For Ubuntu 14.04 create the file:

/etc/lightdm/lightdm.conf.d/12-autologin.conf

and add:

[SeatDefaults]
autologin-user=youruser
share|improve this answer
    
I had to create this file and all it had was this and worked! –  Peter Oct 20 at 12:39
gksu gedit /etc/lightdm/lightdm.conf

add lines:

autologin-user=username
autologin-user-timeout=0

example:

[SeatDefaults]

user-session=ubuntu

greeter-session=unity-greeter

autologin-user=alan

autologin-user-timeout=0
share|improve this answer

Open settings, select 'user accounts'. Click the unlock button, then change the Automatic Login switch to "On"

share|improve this answer
1  
Thank you Luyang Liu, but this optino is not displayed in User Accounts. –  Agmenor Jan 17 '13 at 18:34

Search for "User Accounts" application. Select the account you want to autologin Toggle the Automatic Login switch to On

That should do the work.

share|improve this answer

I have 12.10 xubuntu. In users and groups choose your user, and click word "Change..." next to "Password:" (it does not look like a button, what might be a bit misleading). There you can change password, or at the bottom mark "Don't ask for password on login" box.

Hope it works.

share|improve this answer
    
Thank you very much Chris. However, as explained in my question, this solution is not displayed in User Accounts. –  Agmenor Jan 17 '13 at 18:34

I just discovered that, I need to have ubuntu-desktop to be install before lightdm could function. This solved my issue when trying to get lightdm to actually login in without going in loop.

The reason for the system to go in loop may be because lightdm needs the ubuntu desktop before it may work.

sudo apt-get install ubuntu-desktop
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.