This quick tutorial shows you how to enable passwordless login in Ubuntu, so you can just click user name on the login screen to log it in without typing password or using any other authentication method.
This tutorial is tested and works in Ubuntu 18.04, Ubuntu 20.04, Ubuntu 22.04, and Ubuntu 24.04. Not only for the default GNOME Desktop, but also for XUbuntu (XFCE), Ubuntu MATE, Ubuntu Cinnamon, Ubuntu Unity, LUbuntu (LXQt), KUbuntu and Ubuntu Studio (KDE).
Most Linux (including Ubuntu, Fedora, Arch, Debian) uses PAM module for system-wide user authentication. It includes pam_succeed_if.so
library allows to succeed or fail authentication by custom configuration such as user in group or user in given name.
The config files for PAM module are located in /etc/pam.d
directory. Meaning you can create (or edit directly) a config file there, and write a rule to allows no password login.
Step 1: Create nopasswdlogin group
The common way to enable this feature, is first create a group, set this group to login without password authentication, finally add any user to the group for no password login.
NOTE: as far as I know, XUbuntu, Ubuntu MATE, Ubuntu Cinnamon, and Ubuntu Unity already have “nopasswdlogin” group which is properly configured for passwordless login!
1. First, check if your system has the ‘nopasswdlogin’ group out-of-the-box by running command in terminal (Ctrl+Alt+T):
cat /etc/group | grep nopass
If your system already has the group, just go step 3 to add your username into that group and done.
2. If NOT, then run command in a terminal window to manually create the group:
sudo groupadd nopasswdlogin
Step 2: Set passwordless login for nopasswdlogin group
NOTE: Please do this step carefully. A typo can cause login issues!!
1. After manually created that group, run command in terminal to edit the config file for PAM module:
sudo editor /etc/pam.d/gdm-password
For KUbuntu, Ubuntu Studio and LUbuntu, use sudo editor /etc/pam.d/sddm
instead. If you’re using LightDM display manager and the feature is not enabled out-of-the-box, then run sudo editor /etc/pam.d/lightdm
instead to edit.
2. When file opens, add the line below in very beginning, so all users in that group allow to login without typing password.
auth sufficient pam_succeed_if.so user ingroup nopasswdlogin
For choice, you may use auth sufficient pam_succeed_if.so user = ji
So, user ‘ji’ (replace username) can login passwordlessly.
Finally, press Ctrl+S to save and Ctrl+X to exit.
Step 3: Add user to nopasswdlogin group
After created the group, and set PAM module to allow any user in that group to login passwordlessly, you can now add your username to the group.
To add current user into the group, open terminal and run command:
sudo gpasswd --add $USER nopasswdlogin
Or replace $USER
with any username as you want.
And to disable passwordless login, just remove user from the group. For example, disable the feature for current user via command:
sudo gpasswd --delete $USER nopasswdlogin
Undo the changes
As mentioned in last command, you can delete user from ‘nopasswdlogin’ to disable no password login for that user.
If you want to completely disable this feature, then use command to delete the group:
sudo groupdel nopasswdlogin
Then, re-run the command in “Step 2” to edit the config file and delete the line you just added. Finally reboot computer to apply.
is it possible to do something similar with updates and installs, l only install from the software center and upgrade through the upgrade manager so i cant see the need for passwords to do this
Hi, there.
Seems to be useful information, but still did’t work for me.
In your group creating screen it seems, that only one user may be selected. I had the same situation and that user was me, with permissions of administrator.
I’ve added users by command:
sudo usermod -a -G nopasswdlogin
Still not working.
Maybe any suggestions?