24

I just installed Ubuntu 12.10 and afterwards, I accidentally set the administrator account password to empty/null. This gave me problems when trying to do administrative tasks in the GUI, so after reading up on askubuntu I used the passwd command to set the password for the account anew.

However, at the login screen when clicking on the account, I'm not asked to enter the password; but, instead, I log in directly as if there is no password set for the account.

When doing administrative tasks in the GUI, I will be asked for a password.

What do I do to be asked for the password at login time?

I did already try, several times, in the User Account settings window to set a new password for the account. That is, in the settings window it does not say "login without a password" for my account and it shows that there is a password set for the account.

Kevin Bowen
  • 20,055
  • 57
  • 82
  • 84
T. N.
  • 241

7 Answers7

18

Run the following command in terminal:

sudo gpasswd -d username nopasswdlogin

substitute your username for username.

green
  • 14,406
Arthur Tan
  • 189
  • 1
  • 3
16

I believe all you need to do is go to the "Settings->User Accounts->Unlock->Automatic Login-> Off"

If that doesn't work you can always create a new account and delete your old one. If it is a fresh install this might be the easiest.

You can also manually edit the lightdm configuration file

gksu gedit /etc/lightdm/lightdm.conf

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

Put the pound(number #) symbol in front of all the autologin lines.

One of those has to work. Hope this helps.

Goddard
  • 4,860
5

This was my solution on Ubuntu 18.04: Open your Unity Launcher and click users. Following window will open:

enter image description here

All you need to do is:

  1. Unlock user by clicking top-right button shown in the picture
  2. Uncheck "Automatic Login"
Scott
  • 161
1

None of the other answers worked for me. I'm running Ubuntu 18.04, and I had to go to Settings -> Details -> Users, and then press the "Unlock" button in the top right. Then switch the "Automatic Login" to OFF. And that's it.

0

I know this is old, but I found the solution and want to share for future reference (this is the first page that comes up on Google for the question asked)

Go to "User and Groups" (not "User Accounts") and you will find the setting

0

open terminal

sudo gedit /etc/lightdm/lightdm.conf

should have gedit installed or you can use nano

sudo nano /etc/lightdm/lightdm.conf

just replace line

autologin-user=username

with

autologin-user=false

or

#autologin-user=username

save it and exit. Now it will ask for the password at startup screen.

-1

Run the following command, making sure that you have replaced username with your username:

sudo gpasswd -d username nopasswdlogin
Pratik
  • 1