Enable Automatic Login in Ubuntu 24.04 & Flavors

0
183

This simple tutorial shows how to automatically login a user account in Ubuntu 24.04 and its flavors, such as KUbuntu 24.04, XUbuntu 24.04, Ubuntu MATE 24.04, and Ubuntu Unity 24.04.

The auto login feature is handled by the display manager service in most Linux. It varies depends on your desktop environment and user configuration.

Here I’m going to show you how to enable this feature, either using graphical setting option or by editing config file from command line. Choose either one that you prefer.

Option 1: Use Graphical Option to Enable Auto-Login

Most Desktop Environments provide their own setting options for enable this behavior.

For GNOME (default in Ubuntu 24.04)

For the default GNOME Desktop, simply press Super (Windows Logo) + S to trigger top-right system status menu (aka Quick Settings), then click open “Settings”.

Then, navigate to System in left, and click on Users in right. Click “Unlock” and type your password to authenticate. Finally, select the user account and turn on the “Automatic Login” option for it.

For Ubuntu 22.04 and earlier, “Users” setting is available in left rather than ‘System’ page.

Ubuntu MATE 24.04

For Ubuntu MATE 24.04, just launch Control Center from start menu. When it opens, navigate to Administration -> MATE User Manager.

In the next dialog, choose your user account, click “Unlock” and authenticate with your password, finally turn on the “Automatic login” toggle option.

KUbuntu 24.04 / Ubuntu Studio 24.04

For KUbuntu and Ubuntu Studio with Plasma Desktop, launch System Settings then search & open Login Screen from left.

Then click Behavior button in bottom, finally turn on “Automatically log in” checkbox, choose username and session. For choice, you may enable “Log in again immediately after logging off”.

Ubuntu Unity 24.04

For the Unity desktop, open Settings and navigate to User Accounts. In pop-up dialog, click “Unlock” (need authenticate with user password), choose user from left, and finally turn on “Automatic Login” toggle option.

Ubuntu Cinnamon 24.04

For Cinnamon Desktop environment, open System Settings and click Login Window under Administration section.

In pop-up dialog, switch to Users tab. Under “Automatic login”, inset the username you want to login automatically, and type a number if you want to delay the login with a few seconds.

Option 2: Enable Auto Login by editing Config file

For XUbuntu, LUbuntu, and other Linux Desktop that you cannot find a graphical option, here’s how to enable auto login by editing the config file.

Find out Which Display Manager is in Use

Each desktop environment has its own default display manager. They are:

  • gdm3 – GNOME Display Manager, that is default in GNOME Desktop (the default in Ubuntu).
  • LightDM – Light Display Manager, default in XUbuntu, Ubuntu MATE, Ubuntu Cinnamon, Ubuntu Unity.
  • SDDM – Simple Display Manager, that is default in KUbuntu, Ubuntu Studio, LUbuntu.

In case you’ve changed something, you can press Ctrl+Alt+T to open terminal, and run command to check which display manager is currently in use:

systemctl status display-manager

For GDM3 (GNOME Display Manager), default in Ubuntu

1. For gdm3 display manager that’s in use by default in GNOME Desktop, open up a terminal window (press Ctrl+Alt+T in Ubuntu), and run command to edit the config file:

sudo editor /etc/gdm3/custom.conf

Replace editor with your system text editor, or use nano that works in most Linux.

2. When file opens in text editor, add following line (or un-comment the lines by removing # at the beginning) under [daemon] section (replace user “ji” to yours):

AutomaticLoginEnable = true
AutomaticLogin = YOUR_USERNAME

Or, use the lines below instead that auto-login with delay:

TimedLoginEnable = true
TimedLogin = YOUR_USERNAME
TimedLoginDelay = 10

Finally, press Ctrl+S to save file, Ctrl+X to exit. The change will apply in next boot.

Enable Auto-login for LightDM

1. For LightDM that is default in XUbuntu, Ubuntu MATE, Ubuntu Unity, and Ubuntu Cimmaon, open terminal (Ctrl+Alt+T) and run command:

sudo editor /etc/lightdm/lightdm.conf.d/autologin.conf

The command will create a “autologin.conf” file (change name to whatever as you want) under /etc/lightdm/lightdm.conf.d directory, and edit with system default command line nano text editor.

2. When file opens, add following lines and save it:

[SeatDefaults]
autologin-user=YOUR_USER_NAME
autologin-user-timeout=5

Here autologin-user-timeout=5 is optional to show login-screen for 5 seconds until auto-login, in case you want to log into another user. When done editing, press Ctrl+S to save, and Ctrl+X to exit.

Enable auto-login for SDDM

1. For SDDM display manager that is default in KUbuntu, Ubuntu Studio, LUbuntu, run the command (Ctrl+Alt+T) below instead to edit config file:

sudo editor /etc/sddm.conf.d/auto-login.conf

Or edit /etc/sddm.conf if your system have it out-of-the-box.

2. When file opens, in text editor add following lines (skip [Autologin] if already exist):

[Autologin]
User=YOUR_USER_NAME
Relogin=true

Here Relogin=true is optional feature that automatically log in back once you log out. Sadly, SDDM seems not supporting auto-login delay at the moment of writing. See this request page.

When done editing the file, press Ctrl+S to save file and Ctrl+X to exit. Auto-login will apply at next boot.



LEAVE A REPLY

Please enter your comment!
Please enter your name here