How to set up automatic login in Linux with SDDM
April 9, 2023
SDDM is an X11 and Wayland display manager based on QML.
In my Linux installations, the SDDM display manager performed better than GDM, LightDM. So if you're having trouble with other display managers, try SDDM.
Make sure that the OS uses SDDM:
systemctl status display-manager
The line
sddm.service - Simple Desktop Display Manager
confirms that SDDM is used as the display manager on this Linux.
SDDM supports automatic login using the configuration file of this display manager.
For the configuration file, you need to know the values of two variables:
- Linux username to be automatically logged in
- session name (which desktop environment to run)
To find out the name of the current user in the OS, run the following command:
echo $USER
In my example username:
mial
To find out the session names for X, run the command:
ls -l /usr/share/xsessions/
To find out session names for Wayland, run the command:
ls -l /usr/share/wayland-sessions/
I want to use X session, available on my system are:
- cinnamon2d
- cinnamon
- gnome-xorg
From this list, I choose cinnamon.
Now we need to edit the /etc/sddm.conf.d/autologin.conf file. If this file does not exist, then create it. The /etc/sddm.conf.d/ directory may also not be present on your system. If so, then first create it:
sudo mkdir /etc/sddm.conf.d/
Now open the file for editing or create it:
sudo gedit /etc/sddm.conf.d/autologin.conf
Add the following lines to this file:
[Autologin] User=USER Session=SESSION
Where:
- USER is the username
- SESSION is the X or Wayland session
In my case it turned out like this:
[Autologin] User=mial Session=cinnamon
Save and close the file.
Restart your computer to verify that automatic login is now working:
Related articles:
- How to enable automatic login in Linux (GDM, LightDM, SDDM) (100%)
- How to change Display manager and login screen in Linux (100%)
- How to migrate from X11 to Wayland? (100%)
- How to set up automatic login in Linux with LightDM (70%)
- How to set up automatic login in Linux with GDM (70%)
- How to delete Wi-Fi network settings in Linux (RANDOM - 50%)