
{"id":8607,"date":"2019-02-04T16:48:37","date_gmt":"2019-02-04T16:48:37","guid":{"rendered":"http:\/\/ubuntuhandbook.org\/?p=8607"},"modified":"2024-05-15T09:18:23","modified_gmt":"2024-05-15T09:18:23","slug":"enable-passwordless-login-ubuntu-18-04","status":"publish","type":"post","link":"https:\/\/ubuntuhandbook.org\/index.php\/2019\/02\/enable-passwordless-login-ubuntu-18-04\/","title":{"rendered":"Enable Passwordless Login in Ubuntu 24.04 | 22.04"},"content":{"rendered":"<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/02\/login-figure.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-thumbnail wp-image-45668\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/02\/login-figure-250x250.webp\" alt=\"\" width=\"250\" height=\"250\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/02\/login-figure-250x250.webp 250w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/02\/login-figure-300x300.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/02\/login-figure-700x700.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/02\/login-figure-768x768.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/02\/login-figure.webp 1200w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/a><\/p>\n<p>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.<\/p>\n<p>This tutorial is tested and works in <b>Ubuntu 18.04<\/b>, <b>Ubuntu 20.04<\/b>, <b>Ubuntu 22.04<\/b>, and <b>Ubuntu 24.04<\/b>. 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).<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/jammy-loginbackground.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-39284\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/jammy-loginbackground-600x290.jpg\" alt=\"\" width=\"600\" height=\"290\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/jammy-loginbackground-600x290.jpg 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/jammy-loginbackground-300x145.jpg 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/jammy-loginbackground-768x371.jpg 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/jammy-loginbackground.jpg 1366w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p><!--more--><\/p>\n<p>Most Linux (including Ubuntu, Fedora, Arch, Debian) uses <a href=\"http:\/\/www.linux-pam.org\/\" target=\"_blank\" rel=\"noopener\">PAM<\/a> module for system-wide user authentication. It includes <code>pam_succeed_if.so<\/code> library allows to succeed or fail authentication by custom configuration such as user in group or user in given name.<\/p>\n<p>The config files for PAM module are located in <code>\/etc\/pam.d<\/code> directory. Meaning you can create (or edit directly) a config file there, and write a rule to allows no password login.<\/p>\n<h3>Step 1: Create nopasswdlogin group<\/h3>\n<p>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.<\/p>\n<p><b>NOTE: as far as I know, XUbuntu, Ubuntu MATE, Ubuntu Cinnamon, and Ubuntu Unity already have &#8220;nopasswdlogin&#8221; group which is properly configured for passwordless login!<\/b><\/p>\n<p><b>1.<\/b> First, check if your system has the &#8216;nopasswdlogin&#8217; group out-of-the-box by running command in terminal (Ctrl+Alt+T):<\/p>\n<pre>cat \/etc\/group | grep nopass<\/pre>\n<p>If your system already has the group, just <strong><em>go step 3<\/em><\/strong> to add your username into that group and done.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2019\/02\/cinnamon-enable-nopasswdlogin.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-46594\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2019\/02\/cinnamon-enable-nopasswdlogin.webp\" alt=\"\" width=\"663\" height=\"385\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2019\/02\/cinnamon-enable-nopasswdlogin.webp 663w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2019\/02\/cinnamon-enable-nopasswdlogin-300x174.webp 300w\" sizes=\"auto, (max-width: 663px) 100vw, 663px\" \/><\/a><\/p>\n<p><b>2.<\/b> If NOT, then run command in a terminal window to manually create the group:<\/p>\n<pre>sudo groupadd nopasswdlogin<\/pre>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2019\/02\/create-nopasswdgroup.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-46595\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2019\/02\/create-nopasswdgroup-700x250.webp\" alt=\"\" width=\"610\" height=\"218\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2019\/02\/create-nopasswdgroup-700x250.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2019\/02\/create-nopasswdgroup-300x107.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2019\/02\/create-nopasswdgroup-768x274.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2019\/02\/create-nopasswdgroup.webp 866w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<h3>Step 2: Set passwordless login for nopasswdlogin group<\/h3>\n<p><b>NOTE: Please do this step carefully. A typo can cause login issues!!<\/b><\/p>\n<p>1. After manually created that group, run command in terminal to edit the config file for PAM module:<\/p>\n<pre>sudo editor \/etc\/pam.d\/gdm-password<\/pre>\n<p>For KUbuntu, Ubuntu Studio and LUbuntu, use <code>sudo editor \/etc\/pam.d\/sddm<\/code> instead. If you&#8217;re using LightDM display manager and the feature is not enabled out-of-the-box, then run <code>sudo editor \/etc\/pam.d\/lightdm<\/code> instead to edit.<\/p>\n<p>2. When file opens, add the line below in very beginning, so all users in that group allow to login without typing password.<\/p>\n<pre>auth sufficient pam_succeed_if.so user ingroup nopasswdlogin<\/pre>\n<p>For choice, you may use <code>auth sufficient pam_succeed_if.so user = ji<\/code> So, user &#8216;ji&#8217; (replace username) can login passwordlessly.<\/p>\n<p>Finally, press Ctrl+S to save and Ctrl+X to exit.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2019\/02\/set-nopasswdlogin-group.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-46596\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2019\/02\/set-nopasswdlogin-group-700x508.webp\" alt=\"\" width=\"610\" height=\"443\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2019\/02\/set-nopasswdlogin-group-700x508.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2019\/02\/set-nopasswdlogin-group-300x218.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2019\/02\/set-nopasswdlogin-group-768x558.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2019\/02\/set-nopasswdlogin-group.webp 866w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<h3>Step 3: Add user to nopasswdlogin group<\/h3>\n<p>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.<\/p>\n<p>To add current user into the group, open terminal and run command:<\/p>\n<pre>sudo gpasswd --add $USER nopasswdlogin<\/pre>\n<p><i>Or replace <code>$USER<\/code> with any username as you want.<\/i><br \/>\n<a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2019\/02\/add-user2nopasswdlogin.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-46597\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2019\/02\/add-user2nopasswdlogin-700x268.webp\" alt=\"\" width=\"610\" height=\"234\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2019\/02\/add-user2nopasswdlogin-700x268.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2019\/02\/add-user2nopasswdlogin-300x115.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2019\/02\/add-user2nopasswdlogin-768x294.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2019\/02\/add-user2nopasswdlogin.webp 866w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p>And to disable passwordless login, just remove user from the group. For example, disable the feature for current user via command:<\/p>\n<pre>sudo gpasswd --delete $USER nopasswdlogin<\/pre>\n<h3>Undo the changes<\/h3>\n<p>As mentioned in last command, you can delete user from &#8216;nopasswdlogin&#8217; to disable no password login for that user.<\/p>\n<p>If you want to completely disable this feature, then use command to delete the group:<\/p>\n<pre>sudo groupdel nopasswdlogin<\/pre>\n<p>Then, re-run the command in &#8220;Step 2&#8221; to edit the config file and delete the line you just added. Finally reboot computer to apply.<\/p>","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":45668,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[1640],"class_list":["post-8607","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","tag-passwordless-login"],"_links":{"self":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/8607","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/comments?post=8607"}],"version-history":[{"count":0,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/8607\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media\/45668"}],"wp:attachment":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media?parent=8607"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/categories?post=8607"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/tags?post=8607"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}