Automatic Login on Linux

This document explains how to configure automatic login on Linux so the system signs in automatically after startup or reboot, without requiring user interaction.

Automatic login support on Linux depends on the display manager and the desktop environment in use. The most common configurations are covered below.


Supported systems

This guide applies to Linux systems using:

The configuration may differ on other display managers.


Security notice

Enabling automatic login significantly reduces the physical security of the device.

When automatic login is enabled:

This configuration should be used only on personal devices located in trusted and private environments.


Linux-specific considerations


Required information

Before configuring automatic login, the following information is required:


Determine the Linux username

The username is the name of the home directory and can be verified by running: whoami

The returned value is the username that must be used for automatic login.


Method 1: Automatic login with GNOME (GDM)

This is the most common setup on modern Linux distributions.

Graphical configuration

Once enabled, the system will log in automatically at startup.


Manual configuration (GDM)

If the graphical option is not available, automatic login can be configured manually.

Edit the following file: /etc/gdm3/custom.conf

Modify or add the following lines: [daemon] AutomaticLoginEnable=true AutomaticLogin=username

Replace username with the correct Linux username.

Save the file and restart the system.


Method 2: Automatic login with LightDM

On systems using LightDM, automatic login is configured via its main configuration file.

Edit: /etc/lightdm/lightdm.conf

Add or modify the following lines: [Seat:*] autologin-user=username autologin-user-timeout=0

Replace username with the correct Linux username.

Restart the system to apply the changes.


Restart and verify

Restart the computer.

If the configuration is correct:


Notes about disk encryption

This behavior is expected and recommended for security.


Security considerations


Troubleshooting

If automatic login does not work:


Use cases

Automatic login on Linux is commonly used for: