Before I ask the question, would someone please help stipulate the Ubuntu definition for these two seemingly identical but different terms (I've given drafts.):
Autologin - When you power up the computer, you sign directly into your account.
Passwordless Login - When you pick a user at the greeter and you are logged in without a prompt for a password.
Now, for the question. How do we change each via the command line? Is the solution the same for all currently supported releases?
And for those who would rather use the gui method, how is that done?
At the bottom of this pic is the checkbox for a passwordless login. It says:
Don't ask for password on login
How do I do this with the command line?
I honestly don't know the difference. I'm not sure I've seen the phrase "passwordless login" where I haven't just assumed they're talking about auto-login.
For machines that use LightDM (11.04 up) you can add a user to the configuration in
/etc/lightdm/lightdm.conf
using theautologin-user
variable so the file ends up looking something like this:That gives you a screen where that user (
oli
in this case) is logged in automatically after a few seconds. If you want to alter that timeout so it happens more quickly , you can play around with theautologin-user-timeout
variable in the same file.Since none of the answers addresses the actual question
I paraphrase from the ArchWiki:
Add the following line to
/etc/pam.d/lightdm
and create and add yourself to the group
nopasswdlogin
.A
systemctl restart lightdm
will show the effect. :-)Here is how you can enable passwordless login from Ubuntu 11.10 onward.
Go to
System Settings
→User Accounts
Unlock the administrative functions by clicking the Unlock button in the top right corner and entering your password.
Select the user for which you want to enable passwordless login.
Click on the field/button next to Password.
From the Action dropdown list select
Log in without a password
and click the Change button.Ubuntu 18.04 uses GDM again. Similar to Suuuehgi's answer, this will enable passwordless login, but I don't know if it's safe.
I don't know if it's safe, because the
sufficient
control bypasses the other rules that follow, including SELinux session rules, and I don't understand what any of that stuff does.I initially followed the answer from Oli, but the VM complained about running in low-graphics mode. I think Oli turned off/changed a few too many things by clearing greeter-session. In my case, I want the UI to run. To enable this, only required adding two lines to the
/etc/lightdm/lightdm.conf
file.so the complete file looks like:
to test your changes without rebooting
sudo service lightdm restart
See the answer from Suuuehgi (Enable/Disable Passwordless Login/Autologin Via GUI/Command Line)...
but the following should be at the top, the first line in a pam file (before other auth rules)
Btw same works for lightdm as well
/etc/pam.d/lightdm
.