Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[HowTo] Enable Autologin

Share your HowTo, Documentation, Tips and Tricks. Not for support questions!.
Post Reply
Message
Author
User avatar
pbear
Posts: 384
Joined: 2023-08-27 15:05
Location: San Francisco
Has thanked: 2 times
Been thanked: 63 times

[HowTo] Enable Autologin

#1 Post by pbear »

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.
Last edited by pbear on 2024-05-10 04:48, edited 2 times in total.

User avatar
Pinhead
Posts: 4
Joined: 2023-02-06 08:09

Re: [HowTo] Enable Autologin

#2 Post by Pinhead »

In Gnome, automatic login can also be clicked in the settings.

User avatar
pbear
Posts: 384
Joined: 2023-08-27 15:05
Location: San Francisco
Has thanked: 2 times
Been thanked: 63 times

Re: [HowTo] Enable Autologin

#3 Post by pbear »

Thanks, didn't see that in my research (Gnome isn't my primary desktop). To unpack it a little, autologin is an option under Settings > Users. Admin password required to unlock the option.
Interestingly (to me, at least), adds two lines to the config file, rather than editing the (commented out) lines already in place.

Fossy
df -h | participant
df -h | participant
Posts: 343
Joined: 2021-08-06 12:45
Has thanked: 34 times
Been thanked: 32 times

Re: [HowTo] Enable Autologin

#4 Post by Fossy »

pbear wrote: 2024-04-09 04:59 .....
LightDM - Cinnamon, Mate, XFCE, LXDE. Open /etc/lightdm/lightdm.conf for editing with elevated privileges. 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.
Cinnamon : My “ default “ ??? settings Calamares install

sudo nano /etc/lightdm/lightdm.conf

Code: Select all

greeter-session=lightdm-gtk-greeter
#greeter-hide-users=false
#greeter-allow-guest=true
#greeter-show-manual-login=false
#greeter-show-remote-login=true
user-session=cinnamon
#allow-user-switching=true
#allow-guest=true
#guest-session=
#session-wrapper=lightdm-session
#greeter-wrapper=
#guest-wrapper=
#display-setup-script=
#display-stopped-script=
#greeter-setup-script=
#session-setup-script=
#session-cleanup-script=
#autologin-guest=false
autologin-user=( my user name ) 
#autologin-user-timeout=0
#autologin-in-background=false
#autologin-session=
#exit-on-failure=false
as you can see :
1/ autologin-user= ( my user name ) is already “ uncommented .
2/ #autologin-user-timeout=0 not yet

Do you think I need to worry about anything?
ASUS GL753VD / X550LD / K54HR / X751LAB ( x2 )
Bookworm12.5_Cinnamon / Calamares Single Boot installations
Firefox ESR / DuckDuckGo / Thunderbird / LibreOffice / GIMP / eID Software

https://cdimage.debian.org/debian-cd/cu ... so-hybrid/

dlu2021
Posts: 213
Joined: 2021-08-13 19:55
Location: Minnesota
Has thanked: 7 times
Been thanked: 42 times

Re: [HowTo] Enable Autologin

#5 Post by dlu2021 »

If you are not using a display manager and just running startx, you can use the following:

viewtopic.php?p=616305#p616305

CwF
Global Moderator
Global Moderator
Posts: 2741
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 45 times
Been thanked: 206 times

Re: [HowTo] Enable Autologin

#6 Post by CwF »

dlu2021 wrote: 2024-04-09 17:19 If you are not using a display manager and just running startx, you can use the following:

viewtopic.php?p=616305#p616305
You can also mix this in a way I call 'by-tty'

It combines with my way of mounting auxiliary drives and tmpfs's according to user within ~/.profile, and having alternate user desktops available.

For example, a simple single user setup may be auto on tty1. For more variability tty1 could remain 'empty' for manual everything, but tty2+ can auto login a particular user. In some cases it's useful for multiple tty's to be active at once.

Mentioned before, since I always have a configuration suitable for the vm environment I dedicate tty2 to this common user with a desktop suited for a vm and tmpfs's for odd things like ~/Desktop or ~/Downloads.

I still haven't come up with a good reason for any DM.

User avatar
wizard10000
Global Moderator
Global Moderator
Posts: 666
Joined: 2019-04-16 23:15
Location: southeastern us
Has thanked: 88 times
Been thanked: 110 times

Re: [HowTo] Enable Autologin

#7 Post by wizard10000 »

CwF wrote: 2024-04-09 17:44...I still haven't come up with a good reason for any DM.
Me neither :)

I add this to ~/.profile to startx on tty1:

Code: Select all

# startx if tty1

if [[ -z "$DISPLAY" ]] && [[ $(tty) = /dev/tty1 ]]; then
 . startx
 logout
fi
we see things not as they are, but as we are.
-- anais nin

User avatar
pbear
Posts: 384
Joined: 2023-08-27 15:05
Location: San Francisco
Has thanked: 2 times
Been thanked: 63 times

Re: [HowTo] Enable Autologin

#8 Post by pbear »

Fossy wrote: 2024-04-09 15:36 Do you think I need to worry about anything?
Frankly, I got that part of the instructions from Debian Wiki and didn't test alternate settings. Will say, testing just now, commenting out the timeout=0 line (restoring the default) seems not to delay boot, which is what I assume uncommenting it is intended to prevent. That's booting a VM from SSD. Might be noticeable on a spinner. Or maybe the advice has become obsolete. Wouldn't expect it to be a problem in any event.

Post Reply