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.

When I start up Ubuntu, I see the login screen. I have my account and a guest account as the choices. When I choose my account by clicking on it, I automatically get logged in with out being required to enter my password.

I want to password protect my account so when someone clicks my account, they have to enter the proper password to get in. I have tried to do this by going to

Settings > User Accounts > My Account

and pressing the Unlock button in the top right corner of the window. I get the Authentication is required to change user data pop up and I enter my password to get access. This is what i see. (I've blacked out my account name)

enter image description here

As you can see Automatic Login is set to OFF but like I said, when I click my account from the login screen I get automatically logged in with out requiring a password. I guess that is not what they mean by automatic login.

UPDATE 1: The user Rinzwind explained to me how Ubuntu On/Off switches work so I made sure that it was set it to Off but when I restart, I get automatically logged in. Then when I open my user account and look at Automatic Login, it is set to On again. Something, maybe a setting in a script, is resetting Automatic Login back to On. Any ideas on why this is happening?

UPDATE 2: The user Rinzwind suggested I see if anything changes in the /etc/lightdm/lightdm.conf when I switch Automatic Login -> On and Off. I did that and did see a change.

When I set Automatic Login to Off

enter image description here

the lightdm.conf file looks like this:

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

but when I set Automatic Login to On

enter image description here

the lightdm.conf file looks like this:

[SeatDefaults]
autologin-guest=false
autologin-user=
autologin-user-timeout=0
autologin-session=lightdm-autologin
user-session=ubuntu
greeter-session=unity-greeter
max@siddhion:~$ 

So as you can see the difference is that when Automatic Login is On autologin-user equals nothing but, when Off, autologin-user equals max which is me. Not sure what difference this makes since even when I set it to Off, I still get logged in automatically. Any ideas?

NOTE 1 When I suspend my laptop and return to it again, I am presented with a prompt to enter my password to access my account. So at least that is working. The problem I am having is when the laptop restarts.

NOTE 2 When my account loads up I always get a pop up saying I have to type in my password to unlock the keyring. Not sure if that is important here.

share|improve this question
    
Is this how your account behaves from the time you have installed Ubuntu or it happened after more than 1 log-in's? –  i08in Mar 20 '13 at 14:54
    
Well about 2 months ago I made a change to Ubuntu where I no longer had to type in my password when I clicked my user account from the initial login screen. After I made that change I started getting the prompt for my password to unlock the keyring. –  max Mar 21 '13 at 12:47

4 Answers 4

I think it's a misunderstanding between automatic and passwordless. In automatic login, the system bypasses the lightdm greeter screen, and goes straight to the named user's desktop session. In passwordless login the user must still select or enter (depending on the show-manual-login flag) their username at the greeter screen, but is not required to authenticate using a password. Only a single user can be the nominated autologin-user, but multiple users may have passwordless logins by adding them to the nopasswdlogin group.

You can see which users (if any) are allowed to log in without supplying a password by examining the group membership e.g.

$ getent group nopasswdlogin
nopasswdlogin:x:112:steeldriver

To turn off the behavior, you can follow the GUI method described by @Boris using the Gnome users-admin tool, or simply remove the user from the nopasswdlogin group using the command-line gpasswd command i.e

sudo gpasswd --delete user nopasswdlogin

share|improve this answer

I just had same problem, and solve it after reading this wiki about users and groups.
I found an other GUI application to manage users:

This application is users-admin part of Gnome System Tools.
Install it with this command line:

sudo apt-get install gnome-system-tools

Launch it with the command:

users-admin 

enter image description here

In front of Password you should have Not requested at logon (translated from french)
Click then on Modify and a new window will appear.

enter image description here

Just untick the last option Do not ask password at connection

And problem should be solved.

share|improve this answer

I have managed to fix this on my PC running 12.10. I created another user account with administrator privileges and password and switched automatic login off on the new account. I rebooted my PC and the old account then allowed me to login but still did not ask for my password. However the new administrator account created required a password to login. I then logged out of my old administrator account and logged into my new administrator account using the new account's password. I then disabled the old administrator account using the new administrator account. I then rebooted my PC. Then logged into my new administrator account again. I then re-enabled my old administrator account and set a new password and automatic login switched off. I then rebooted my PC again and it worked. My old administrator account required a password before I could log in. The used the new password I set for my old account and it logged in. Fixed. I then used my old administrator account, which now needed a password to login, and removed the new administrator account I created. Problem solved. My original administrator account now requires a password to login each time I switch my PC on. Hope this helps!

share|improve this answer

That slider is ON. See: How to interpret Gnome's ON/OFF toggle buttons?

You need to set it to OFF and make it show ON to turn automatic login OFF.

NOTE: When my account loads up I always get a pop up saying I have to type in my password to unlock the keyring. Not sure if that is important here.

That is something different. I deleted keyring and recreated it without a password. It does not bother me again about unlocking it ;)


edit: the color of the background of the slider changes color.

enter image description here

share|improve this answer
    
Ok right, I see what you mean by the on/off switch. So I set it to off but when I restart, I get automatically logged in. Then when I open my user account and look at Automatic Login, it is set to On again. Something is resetting back to Off it but, I know not what. Any ideas? –  max Mar 21 '13 at 11:32
    
If you use encryption: then you are NOT allowed to use automatic logging in. Also have a look at ` /etc/lightdm/lightdm.conf`. That is the file it uses. Change the slider. Close the window and check if the file got altered. –  Rinzwind Mar 21 '13 at 13:29
    
Hey I updated my post with the results of your suggestion. Also, how do I know if I use encryption? I assume not because I get signed in automatically after a restart. –  max Mar 21 '13 at 21:50
    
Any ideas on how to proceed? –  max Mar 24 '13 at 0:28
    
@Rinzwind I had same problem than Max, it is not due to a misunderstanding of the on/off button –  Boris Nov 30 '13 at 21:48

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.