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:
- GNOME with GDM (Ubuntu, Debian, Fedora)
- LightDM (older Ubuntu versions, some desktop environments)
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:
- The system signs in automatically at boot
- No password is required at the login screen
- Anyone with physical access can use the computer
This configuration should be used only on personal devices located in
trusted and private environments.
Linux-specific considerations
- Automatic login is handled by the display manager
- Disk encryption (LUKS) will still require a password at boot
- Automatic login happens after disk decryption
- Only one user can be configured for automatic login
Required information
Before configuring automatic login, the following information is required:
- The Linux username
- Administrator (sudo) privileges
- The display manager in use (GDM or LightDM)
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
- Open Settings
- Go to Users
- Unlock the settings using administrator privileges
- Enable Automatic Login for the desired user
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:
- Linux will log in automatically
- The desktop will be available immediately after boot
- No password prompt will appear
Notes about disk encryption
- Automatic login does NOT bypass full-disk encryption
- If LUKS encryption is enabled, a password is still required at boot
- Automatic login occurs only after the disk is unlocked
This behavior is expected and recommended for security.
Security considerations
- Automatic login does not bypass BIOS or firmware passwords
- Disk encryption remains the primary security layer
- Anyone with physical access can use the logged-in account
- This configuration prioritizes convenience over physical security
Troubleshooting
If automatic login does not work:
- Verify the correct username is configured
- Ensure the correct display manager is used
- Check configuration file syntax
- Restart the system after changes
- Review system logs for display manager errors
Use cases
Automatic login on Linux is commonly used for:
- Remote desktop access
- Headless or unattended systems
- Home servers
- Raspberry Pi setups
- Systems that must recover automatically after reboot