How to login to Ubuntu 18.04 without a password
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.
Related videos on Youtube
Comments
-
Phil Lord over 1 year
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 over 5 yearsYes, 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.
-
vidarlo over 5 yearsBy default
ssh
disallows login with empty password, so it's only accessible on the local console. You can verify thatPermitEmptyPasswords
is set tono
in/etc/ssh/sshd_config
. -
Phil Lord over 5 yearsYes, I did this for ssh.
-
Phil Lord over 5 yearsOnce 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).
-
Cosmologicon over 4 yearsAm I doing it wrong? >>> ~$ sudo useradd testpasswd >>> ~$ sudo passwd -d testpasswd >>> passwd: password expiry information changed. >>> ~$ su testpasswd >>> Password: [press Enter] >>> su: Authentication failure
-
vidarlo over 4 years@Cosmologicon try to login as that user, not su to it.
-
John Dee about 4 yearsThis 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.
-
vidarlo about 4 years@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.
-
Gopipuli over 3 yearsI think this can be done by enabling autologing in user setting. For me it worked not changed any conf settings.