10

I set my account to be allowed to log in without a password. I only wanted this temporarily, but I can't seem to change it back to how it was before.

How can I make it so that my password is required to log in? I'm not talking about auto-login; at the login prompt I can just hit Enter to log into the system.

When I go into the User Account settings, I do have a password set and the auto-login switch turned off.

5 Answers 5

3

Go to:

System Settings | User Accounts

Double click on User Account. Then select your user and double click.

click Unlock in the upper right hand corner. (you will need to put in your password if you have one).

Ensure your account has a password. Ensure that Automatic Login is turned off for your account.

enter image description here

1
  • Thanks for your suggestion. I tried this, but no luck! I still have the login button on the login screen instead of a password box.
    – Alex
    Jan 13, 2012 at 0:41
1

It sounds like you've set up an empty-password login. If you set a password on the account, using the passwd command in a terminal window, you'll be fixed.

1
  • Thanks for your help. I tried this, but it did not seem to change anything. It still does not require a password to log in.
    – Alex
    Jan 13, 2012 at 0:42
1

Remove the user from nopasswdlogin group

sudo gpasswd -d <USERNAME> nopasswdlogin

please refer to the following link

http://www.tuxgarage.com/2012/07/disable-enable-passwordless-login.html

1
  • I getting error "usermod: group 'nopasswdlogin' does not exist", my need is "su <username>" then login without password. Sep 6, 2016 at 17:40
1
$ . /etc/os-release; echo $NAME, $VERSION
Ubuntu, 20.04.6 LTS (Focal Fossa)

Adding a more recent answer to this: Use the GUI...

  • Hit WinKey / Super
  • begin to type Settings, then click the icon
  • Select User in the left side panel
  • Click Unlock in the upper right corner (sudo user password required)
  • Choose login mode with Automatic login -toggle.

enter image description here

4
  • Probably easier: lsb_release -a Apr 15, 2023 at 16:15
  • Feel free to replace the picture with your own. I stole it from another recent answer to a similar recent question.
    – user68186
    Apr 15, 2023 at 16:58
  • @PabloBianchi yes, but also more lines. ;-)
    – Hannu
    Apr 16, 2023 at 8:32
  • @user68186, that's fine, a bit dark though ;-)
    – Hannu
    Apr 16, 2023 at 8:33
0

I found a solution, but it was quite a work around!

Opening up the Settings -> User Accounts and then setting a password does not work.

However, creating a new administrator account, then logging in with the new account, and then setting a password for the original account seems to do the trick.

I hope that's clear for anyone who experiences the same issue.

You must log in to answer this question.

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