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.

  • So I stumbled over someone (handytutorial.com/manage-users-and-groups-in-ubuntu-12-10-12-04) suggesting to install gnome-system-tools. I did that and it presents the settings for my account as "do not ask at login" (which is exactly what I experience). Changing it using gnome-system-tools solved the problem for me. Could it be a bug in the unity user setting thingy?
    – T. N.
    Nov 4, 2012 at 16:15

7 Answers 7


Run the following command in terminal:

sudo gpasswd -d username nopasswdlogin

substitute your username for username.

  • 2
    You are assuming there is a group name nopasswdlogin? I don't have such agroup.
    – guntbert
    Apr 15, 2013 at 7:07
  • It does not work on Lubuntu 18.0.4. This answer works Jul 3, 2019 at 12:50
  • dont run this command, it removes 'username' from group 'nopasswdlogin'; but that group doesn't exist anyway
    – Dan D.
    Sep 12 at 14:22

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


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

One of those has to work. Hope this helps.

  • 2
    I probably did not explain this very well, the problem was that there was a password set for the (my) administrative account, but I wasn't asked for it at login. I had to actively select and click on the account at the login screen so the account was not setup to auto-login. Hence your suggestion did not solve my particular problem. But thanks anyway.
    – T. N.
    Nov 4, 2012 at 16:10

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

enter image description here

All you need to to is:

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

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.


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


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






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

  • 1
    ubuntu 20.04 LTS shows Directory '/etc/lightdm' does not exist
    – Carlos.V
    Jan 8, 2021 at 16:51

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

sudo gpasswd -d username nopasswdlogin

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .