Enable/Disable Passwordless Login/Autologin Via GUI/Command Line
Solution 1
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 the autologin-user
variable so the file ends up looking something like this:
[SeatDefaults]
autologin-guest=false
autologin-user=oli
autologin-user-timeout=0
autologin-session=lightdm-autologin
greeter-session=
user-session=ubuntu
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 the autologin-user-timeout
variable in the same file.
Solution 2
Since none of the answers addresses the actual question
How do I do this with the command line? (passwordless login)
I paraphrase from the ArchWiki:
Add the following line to /etc/pam.d/lightdm
auth sufficient pam_succeed_if.so user ingroup nopasswdlogin
and create and add yourself to the group nopasswdlogin
.
groupadd -r nopasswdlogin
gpasswd -a <username> nopasswdlogin
A systemctl restart lightdm
will show the effect. :-)
Solution 3
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.
Solution 4
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.
If you want to bypass the password prompt in GDM then simply add the following line on the first line of
/etc/pam.d/gdm-password
:auth sufficient pam_succeed_if.so user ingroup nopasswdlogin
Then, add the group
nopasswdlogin
to your system.Now, add your user to the
nopasswdlogin
group and you will only have to click on your username to login.
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.
Related videos on Youtube
bambuntu
I'm currently working on a Mint/Ubuntu based Lived Distro called Linux Surfer. Linux Surfer is intended for browsing the web safely and protecting your hard drive from web based attacks. It comes with a the Silicon theme. http://www.demonoid.me/files/?uid=8372521&seeded=2 Currently my focus is primarily on permission based protection solutions, which include isolating apps in new user accounts.
Updated on September 18, 2022Comments
-
bambuntu over 1 year
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?
-
bambuntu about 12 yearsI used the conf file the gui made for autologin. I deleted it, and then there was no autologin. I copy it to /etc/lightdm in an upstart script and it doesn't make it autologin. Even after a few reboots. Is there a daemon?
-
Adam Grant over 6 yearsThank you for directly answering the question. However, this had no effect for me. I still see the login prompt when starting up. It prompts me for a username ("login") and password
-
Brian Cain over 6 years@AdamGrant, same results for me on ubuntu 16.04.1.
/var/log/auth.log
contains an entry "lightdm: pam_succeed_if(lightdm:auth): requirement "user ingroup nopasswdlogin" was met by user "brian"
" but nothing of after that. -
Zanna almost 3 yearsRather than posting this as a new answer, it might be better to suggest an edit to Suuuehgi's answer to note that the addition must be the first line. That answer refers to lightdm, but Seaside's answer which does mention that the new line has to be at the start refers to gdm - I think the last sentence of your answer refers to Seaside's answer.