Authentication checks is insignificant sometimes, e.g., for restricted account use for Guests, Children, or even public computers. And here I’m going to show how to enable login without password in Linux with GNOME desktop.
Linux uses PAM, the Pluggable Authentication Modules, for system-wide user authentication. A user can login by typing password, via a fingerprint or smartcard. All the methods will call PAM libraries for authentication checks.
A collection of configuration files under /etc/pam.d directory control which modules to check, in which order with what options. And “pam_succeed_if.so” is a PAM library used to succeed or fail authentication based on the given condition.
By editing the configuration file and adding a rule using the PAM library can do the trick to allow login without password.
Enable No Password Login in GNOME:
The steps below are tested and work in Ubuntu 20.04, Ubuntu 21.10, Debian 11, Fedora 34 and Zorin OS 16 with GNOME desktop.
Firstly, press Windows (Super or mac command) key on keyboard or click top-left corner ‘Activities’ to bring up overview screen. Then search for and open terminal.
When terminal opens, copy and paste the command below into it and hit Enter to edit the “gdm-password” configuration file under /etc/pam.d directory.
sudo gedit /etc/pam.d/gdm-password
Once the file opens, paste the line below as the first line (replace the USER_NAME)!
auth sufficient pam_succeed_if.so user = USER_NAME
It tells PAM to succeed authentication for the given user account (merilyn in picture).
NOTE: Do type the line carefully! A mis-spell can cause login issue, through it can be restored by booting into recovery mode.
Every user in Linux has its own group with the same name. For example, my account is ‘merilyn’ and there’s a group called ‘merilyn’ that includes itself as only user by default. So, you can also replace the previous line with:
auth sufficient pam_succeed_if.so user ingroup USER_NAME
By creating a separate group and adding some users into it, you can even enable no password login for a group of users.
Also, you can replace “user ingroup GROUP_NAME” with “user notingroup GROUP_NAME” to specify users not in a group. There are even more options you can use, run command
man pam_succeed_if in terminal to see details.
After saving the file, your system will login the user account without authentication when clicking on it in next boot. And even in the lock screen, you do not need to type password anymore to activate the desktop.
That’s all. Enjoy!