6

I have just upgraded to Ubuntu 18.04 from 16.04 and I appear to have lost my ability to login without a password. This is something that I used in 16.04 for a media player computer that I have in my living room.

This question appears to have been asked before, and has been marked as a duplicated here:

How can I log in to Ubuntu 18.04 without a password? Setting auto login doesn't work

However, the answers are about auto-login and I do not want this. I want to get a login dialog with a user name that requires no password, not one that auto-logins in on boot. This is so that I can choose which account to login in to (I have one account for playing media and my own "real" account which I use for sys admin), or so that I can choose session types (my media account mostly uses kodi, but sometimes I need a desktop).

This was possible with previous versions of Ubuntu:

http://ubuntuhandbook.org/index.php/2013/07/login-without-a-password-on-ubuntu/

Has it been lost in 18.04?

Phil Lord
  • 226

2 Answers2

8

I do exactly this myself, and upgraded the box from 16.04 to 18.04 a few weeks ago - with zero ill effects.

Run sudo passwd -d username to delete the password for this user.

That should allow you to login without entering a password, and works fine for me on 18.04

If this is your only account on the machine, you should probably either configure passwordless sudo, or add a second account with administrative privileges.

vidarlo
  • 22,691
  • 1
    Yes, I guess this will be the way to go, although I was a bit wary of this because it will effect all authentication, including over a network. I guess the risk are relatively low for a media box, but still. – Phil Lord Dec 15 '18 at 23:19
  • By default ssh disallows login with empty password, so it's only accessible on the local console. You can verify that PermitEmptyPasswords is set to no in /etc/ssh/sshd_config. – vidarlo Dec 15 '18 at 23:24
  • Yes, I did this for ssh. – Phil Lord Dec 15 '18 at 23:48
  • Once you have done this, though, there doesn't appear to be anyway to change the session (from gnome->kodi, or kodi->gnome), since the option to do this is at the password dialog which no longer appears (as soon as you click on the user, you login, not as previously requiring another click). – Phil Lord Dec 15 '18 at 23:50
  • Am I doing it wrong?

    ~$ sudo useradd testpasswd ~$ sudo passwd -d testpasswd passwd: password expiry information changed. ~$ su testpasswd Password: [press Enter] su: Authentication failure

    – Cosmologicon Dec 01 '19 at 17:58
  • @Cosmologicon try to login as that user, not su to it. – vidarlo Dec 01 '19 at 18:08
  • This destroyed my machine. I installed Ubuntu onto MacBook Pro, issued the command. Now I can't execute ANY sudo commands because every time I try one, it asks me for a password, which is now disabled. DON'T DO THIS IF YOU ONLY HAVE ONE ACCOUNT ON THE MACHINE. – John Dee Mar 22 '20 at 12:06
  • @JohnDee It didn't destroy your machine; it's rather trivial to fix. But it's a good point, and I'll include it in my answer. – vidarlo Mar 22 '20 at 12:39
  • For SSH, I also had to disable PAM as well as allow empty passwords. So PermitEmptyPasswords yes and UsePAM no in /etc/ssh/sshd_config – Gonzalo Lucero Feb 01 '23 at 02:18
3

Worked on ubuntu 18.04

sudo nano /etc/gdm3/custom.conf

Go to # Enabling automatic login section Uncomment and do following changes "readib" is username.

AutomaticLoginEnable = true
AutomaticLogin = readib
Dhiren Hamal
  • 215
  • 3
  • 10
  • 1
    I think this can be done by enabling autologing in user setting. For me it worked not changed any conf settings. – Gopipuli Oct 23 '20 at 04:34