34

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
11
  • Which os you are using?
    – Tachyons
    Feb 26, 2012 at 7:04
  • You may removed password .if yes give new password if you are using guest account it wont any password use up/down key to chose your account
    – Tachyons
    Feb 26, 2012 at 7:09
  • Have you tried to change your password? Also can you paste the content of /etc/lightdm/lightdm.conf?
    – desgua
    Feb 26, 2012 at 11:21
  • What exactly means does not work? Feb 26, 2012 at 15:01
  • I think that it doesn't automatically login but instead it doesn't require your password, right? Also can you put the content of /etc/lightdm/lightdm.conf?
    – desgua
    Feb 27, 2012 at 4:17

13 Answers 13

57
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.
2
  • 6
    so sad that this did not get any upvotes. This is THE CORRECT answer. All one needs to do is leave the autologin-user= blank. Thanks a bunch maxeye and @jokerdino Aug 11, 2012 at 14:51
  • Works perfect! I-m in a persistent live usb stick created with YUMI multiboot, and work by leaving the line autologin-user= blank. As is, with "blank" at the end!
    – razor7
    Feb 2, 2016 at 16:35
10

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.

1
  • 1
    i tried yours this is what I got : Removing user suhaib from group nopasswdlogin gpasswd: user 'suhaib' is not a member of 'nopasswdlogin'
    – Suhaib
    Nov 13, 2012 at 22:56
9

System Setings

enter image description here

enter image description here

Disable Automatic Login

2
  • 5
    I have already tried this, it's not working.
    – iammilind
    Feb 22, 2012 at 6:53
  • 1
    If you disable automatic login you'll get a prompted by the keyring for your password. Perhaps that's what you're seeing. This wasn't the case back a couple of Ubuntu releases.
    – fragos
    Feb 26, 2012 at 22:39
6
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.

2
  • I tried it, but no luck.
    – iammilind
    Feb 24, 2012 at 3:28
  • 2
    are you using lightdm ?
    – duffydack
    Feb 26, 2012 at 21:15
3

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.

3
  • I don't have any folder named /etc/gdm. I had tried this option earlier seeing from internet somewhere.
    – iammilind
    Feb 28, 2012 at 4:50
  • 1
    Yeah, this technique only works if gdm is the display manager, but lightdm is the default display manager starting with Ubuntu 11.10. May 10, 2012 at 17:57
  • gdm is the default display manager for Ubuntu Gnome, the official gnome variant of ubuntu. In this case, the technique applies.
    – fret
    Nov 5, 2015 at 8:43
3

Ok, finally the problem is solved. I got an email from an occasional stack-exchange visitor Mr. Rafter. Following is the way:

  • Run sudo grep nopasswd /etc/*
  • This will display at least 2 lines:

    /etc/group:nopasswdlogin:x:112:`<login name>`   
    /etc/gshadow:nopasswdlogin:!::`<login name>`
    
  • Edit those files with sudo and remove only <login name> from those lines and save.

  • Go to "User Accounts" and disable the automatic login
  • Restart the computer and now it should ask for the password again!
1
  • this solution did not work for me :-(
    – Suhaib
    Nov 13, 2012 at 23:03
3
+25

Go to your terminal and enter this:

passwd

It will ask you with your new Unix password and solved.

Then, later, you can go to your user account and change anything.

2
  • Tried it not working.
    – iammilind
    Feb 28, 2012 at 7:42
  • @iammilind maybe there's something wrong with your installation. If you haven't started yet with your project or what other stuffs there then how about try re-installing? Probably this option would save your time.
    – hodl
    Feb 29, 2012 at 11:04
3

Figured out an answer:

  • Boot with Ubuntu live CD.
  • Edit lightdm.conf as root.
  • Comment out (with #) autologon of user.
  • Save and reboot into system.
  • Boot to user login screen, select Ubuntu and enter password.
  • Boot into usual Ubuntu desktop.
1
3

I am running 12.10 and I tried everything in this thread and nothing worked. Eventually I tried deleting suspicious lines in lightdm.conf and was successful:

  • Run gksu gedit /etc/lightdm/lightdm.conf

  • I can't remember the exact line because I have since deleted it, but it's something like autologin-lightdm=true. Delete it.

Hope this works!

1
  • @David's answer is similar to your. You might have missed that.
    – iammilind
    Jan 13, 2013 at 4:02
0

System Settings > User Accounts. Select your user and disable automatic login.

1
  • 3
    I have already tried this, it's not working.
    – iammilind
    Feb 22, 2012 at 6:53
0

Open the file /etc/group (vi /etc/group) and find the group 'nopasswdlogin'. you will see your user name in that group. comment out that line (inserting # before) or just delete the line.

This should do it.

-1

Since you was playing around with "User accounts" and I made same mistake, I got in same hole.

Keep cool.

You just set your system to no-password when "playing around".

That's why your system log in (auto or not) without asking for password, and this is the same reason keyring system asks for it (cause doesn't received from the system).

So, action jackson:

  1. Check what I am talking about. Go to Menu in Top Bar and choose 1st item (Switch User Account...) and see Login button (what mean you already logged and no user to choose, u can just login, u have no pass (OH!)
  2. After clicking Login, and back to desktop, Choose again in top menu bar the logout command, and logout. You gonna see a button with your username, no "login" button.
  3. Correcting things: Setting a new password. Set the same old one, to keyring dont get confused again, or it will ask you for the password again, after login with password provided. Go to same menu of item 1 and choose last item now (User Accounts...) and on this Gui interface , unlock on the respective button probably providing no password at all (just Enter, if this not works try with old pass..), and then THE GREAT MAGIC TRICK

CLICK THE PASSWORD BOX (its a hidden button, oh devil UI)

this open a dialog box (!) where u probably hit the "login without password" option AND with automatic login option ON too (outside this dialog, on User Accounts screen). SO:...

When you tell the computer to log in without a password (ITS NOT the same as Automatic Login) he does exactly this , log in, without password. So password = nothing. Then keyring goes crazy. (aha!) So, choose the right option now:

Set a password now

and after doing all the entry password stuff, simple hit enter, set automatic login off, to feel again the pleasure of having a password, and if you want it on again, ok, turn it on, but dont log in without a password again. =D

I hope this helps you to solve your problem. Was a good lesson to me. Bad UI to Ubuntu -1 on this case.

4
  • Maybe I am just wrong and you still have the same password, but system is set to login without it.
    – H_7
    Mar 3, 2012 at 17:13
  • Correctly question should be "How to set again my system to use sytem password?"
    – H_7
    Mar 3, 2012 at 17:15
  • no need of command line. passwd should do this too. Remember to CLICK the lock icon on User Account screen and provide password (!). Its really a bad bad UI.
    – H_7
    Mar 3, 2012 at 17:29
  • I tried this method as well. Not working.
    – iammilind
    Mar 4, 2012 at 4:22
-1

My /etc/lightdm/lightdm.conf was basically empty:

[SeatDefaults]  
user-session=

It worked with:

sudo gpasswd -d USER nopasswdlogin

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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