[HowTo] Enable Autologin
Posted: 2024-04-09 04:59
Procedure varies depending on which display manager is being used, but it's pretty simple in each case. For purposes of these instructions, I assume you're using the default display manager for your desktop.
GDM (Gnome Display Manager) - Gnome and Flashback. Autologin is an option under Settings > Users; admin password required to unlock the option. [Thanks, Pinhead, for the tip.] Alternatively, open /etc/gdm3/daemon.conf for editing.* Uncomment AutomaticLoginEnable = true (i.e., remove # at beginning of the line); uncomment next line (AutomaticLogin =) and add username of primary user. Save file, close text editor, and reboot to test.
LightDM - Cinnamon, Mate, XFCE, LXDE. Open /etc/lightdm/lightdm.conf for editing. Search for autologin-user=; uncomment line (remove #) and add username; also uncomment next line (autologin-user-timeout=0). Save file, close text editor, and reboot to test. As discussed below, it's not clear the second modification is needed, or even does anything, but it's the official Debian recommendation.
KDE - System Settings > Startup & Shutdown > Login Screen > Behavior (lower-center); also, blank password for KDE Wallet.
LXQt - Autologin can be set up manually. For example, sudo nano /etc/sddm.conf will create the file and open for editing. Add four lines per link. Save file and exit nano.
* For new users not familiar, Linux protects system files from inadvertent editing by requiring an administrative password. This can be done by switching to user-root or by prefixing the command with sudo (provided the user has admin privileges). One can switch to user-root with su - (enter root's password at the prompt), then (for example) nano /etc/gdm3/daemon.conf. Or, if sudo is enabled (default when installing with a live ISO, can be added post-installation with the standard installer), the command is sudo nano /etc/gdm3/daemon.conf. nano is a simple text editor, but adequate for config files and worth learning, as it's available in every Linux distribution and always works the same way. Navigate within the file with arrow keys; delete with backspace; type text the normal way. When done, type Ctrl-O (letter "O", for write-Out), tap Enter to confirm overwrite of filename, then Ctrl-X to exit nano. Alternatively, assuming sudo is enabled, each desktop permits config files to be edited with a GUI text editor, but details vary.
By the way, the Calamares installer used by the live ISOs has a check-box to enable autologin. Do not use this. I like the Calamares installer, but it has a bug on this point. Ticking that box creates a group called autologin which is assigned a group id (gid) of 1000, which should be the primary user's gid. Instead, you get a gid of 1001, which makes permissions of all your files non-standard. Takes less than a minute to enable autologin post-installation. Do it that way.
Edited to reflect feedback and to add a link for how to set up autologin manually in LXQt.
GDM (Gnome Display Manager) - Gnome and Flashback. Autologin is an option under Settings > Users; admin password required to unlock the option. [Thanks, Pinhead, for the tip.] Alternatively, open /etc/gdm3/daemon.conf for editing.* Uncomment AutomaticLoginEnable = true (i.e., remove # at beginning of the line); uncomment next line (AutomaticLogin =) and add username of primary user. Save file, close text editor, and reboot to test.
LightDM - Cinnamon, Mate, XFCE, LXDE. Open /etc/lightdm/lightdm.conf for editing. Search for autologin-user=; uncomment line (remove #) and add username; also uncomment next line (autologin-user-timeout=0). Save file, close text editor, and reboot to test. As discussed below, it's not clear the second modification is needed, or even does anything, but it's the official Debian recommendation.
KDE - System Settings > Startup & Shutdown > Login Screen > Behavior (lower-center); also, blank password for KDE Wallet.
LXQt - Autologin can be set up manually. For example, sudo nano /etc/sddm.conf will create the file and open for editing. Add four lines per link. Save file and exit nano.
* For new users not familiar, Linux protects system files from inadvertent editing by requiring an administrative password. This can be done by switching to user-root or by prefixing the command with sudo (provided the user has admin privileges). One can switch to user-root with su - (enter root's password at the prompt), then (for example) nano /etc/gdm3/daemon.conf. Or, if sudo is enabled (default when installing with a live ISO, can be added post-installation with the standard installer), the command is sudo nano /etc/gdm3/daemon.conf. nano is a simple text editor, but adequate for config files and worth learning, as it's available in every Linux distribution and always works the same way. Navigate within the file with arrow keys; delete with backspace; type text the normal way. When done, type Ctrl-O (letter "O", for write-Out), tap Enter to confirm overwrite of filename, then Ctrl-X to exit nano. Alternatively, assuming sudo is enabled, each desktop permits config files to be edited with a GUI text editor, but details vary.
By the way, the Calamares installer used by the live ISOs has a check-box to enable autologin. Do not use this. I like the Calamares installer, but it has a bug on this point. Ticking that box creates a group called autologin which is assigned a group id (gid) of 1000, which should be the primary user's gid. Instead, you get a gid of 1001, which makes permissions of all your files non-standard. Takes less than a minute to enable autologin post-installation. Do it that way.
Edited to reflect feedback and to add a link for how to set up autologin manually in LXQt.