17

I have started running Jessie (Debian 8) with a LightDM/Xfce desktop on my HTPC after it grinding to a near-halt on W7. One of the things that I cannot get past is having to type the password -- not a normal thing to do for watching TV.

Following the instructions on the Debian Wiki I got as far as my login being automatically selected. But this still requires the password, and half-fixes like empty / trivial passwords are not allowed.

Is it possible to go straight to the Xfce session without login/password?

6 Answers 6

20

This page describes how to enable it.

Edit the LightDM configuration file and ensure these lines are uncommented and correctly configured:

/etc/lightdm/lightdm.conf

[Seat:*]
pam-service=lightdm
pam-autologin-service=lightdm-autologin
autologin-user=username
autologin-user-timeout=0
session-wrapper=/etc/X11/Xsession
greeter-session=lightdm-greeter

LightDM goes through PAM even when autologin is enabled. You must be part of the autologin group to be able to login automatically without entering your password:

# groupadd -r autologin
# gpasswd -a username autologin
8
  • Thanks! The arch docs seem more complete than Debian's... Unfortunately the settings don't translate. I changed it so that lightdm --show-config gives greeter-session=lightdm-greeter and session-wrapper=/etc/X11/Xsession, the lines about pam and auto-login-user are the same. Without the greeter-session line X does not start. <br> I did the bit for the autologin group but still had to type my password. Then I did the bit for the nopasswdlogin group and then neither my password nor the root were accepted by lightdm??
    – alle_meije
    Aug 11, 2016 at 19:49
  • ok, so, it does work in the end with some tweaking?
    – madeddie
    Aug 11, 2016 at 19:50
  • no - the only tweaking I did was adding the other group as documented on the Arch wiki. But I had to remove that to get into X at all..
    – alle_meije
    Aug 11, 2016 at 19:55
  • 1
    i'm at a loss actually and sadly don't have an xfce system i can easily test on
    – madeddie
    Aug 11, 2016 at 20:13
  • 1
    Successfully configured auto login for Debian 10 with these instructions. Oct 29, 2019 at 21:15
8

here is the correct answer for Debian 9 Jessie, for all of you who need help the correct way.

Add Auto Login to Debian

First you need switch to the LightDM (Desktop Manager).

  1. Switch to LightDM**

    sudo dpkg-reconfigure lightdm
    
  2. Add the Autologin account**

    sudo groupadd -r autologin
    
    sudo gpasswd -a YOURUSERNAME autologin
    
  3. Edit the LightDM Config Files

    sudo leafpad /etc/lightdm/lightdm.conf
    

Add all 3 of these lines below to the file and save it:

[SeatDefaults]
autologin-user=YOURUSERNAME
autologin-user-timeout=0
autologin-session=xfce

Now, notice that above has XFCE as the session. If you use gnome, cinnamon, etc., make sure you specify what session (GUI) you use, otherwise above will log you into XFCE and you may not have it installed.

If you don't know, type

echo $DESKTOP_SESSION
0
7

In Debian 9 and 10 with Xfce, all I had to do was add this to /etc/lightdm/lightdm.conf:

[Seat:*]
autologin-user=david

Despite what the other answers say, my user does not need to be in the autologin group and I didn't need to do anything with PAM.

(Source: https://wiki.debian.org/LightDM#Enable_autologin)

2
  • 1
    I can confirm this on Debian 10.5 (buster).
    – famzah
    Aug 21, 2020 at 17:14
  • I confirm it works on 10.4.
    – Basj
    Sep 30, 2021 at 12:43
3

I solved it using the Debian wiki page and this page on LinuxServe -- especially the comment!

when I do /usr/sbin/lightdm --show-config I get two files: /etc/lightdm/lightdm.conf and /usr/share/lightdm/lightdm.conf.d/01_debian.conf

These I edited so that in /usr/share/lightdm/lightdm.conf.d/01_debian.conf it says:
greeter-session=lightdm-greeter
session-wrapper=/etc/X11/Xsession

and in /etc/lightdm/lightdm.conf it says:
autologin-user=username
autologin-user-timeout=0

The trick was that, as the comment at the end of the second link says, that the autologin settings need to be in the [SeatDefaults] section of the file. There are two places where the lines appear, commented, and I had uncommented the first place.

It was a bit strange because in normal settings files for Debian, lines like these don't appear twice -- but I should have taken a better look!

2
  • That's a great answer. For Debian 9.0.3 'stretch', your instructions work perfectly for xcfe, and the values you show for 01_debian.conf are the default values, so all I needed to change was in lightdm.conf
    – clearlight
    Jan 28, 2018 at 21:28
  • NOTE: root user: If autologin-user=root, autologin will silently fail unless you also comment-out auth required pam_succeed_if.so user != root quiet_success in /etc/pam.d/lightdm-autologin
    – clearlight
    Jan 28, 2018 at 21:31
2

Below worked for me. I was logged as root.

  1. Add user to autologin goup

groupadd -r autologin gpasswd -a YOURUSERNAME autologin

  1. Edit config file -> /etc/lightdm/lightdm.conf Change part below [Seat:*] -> uncomment and fill data

autologin-user=YOURUSERNAME autologin-user-timeout=0 autologin-session=DESKTOP_SESSION

2a. If you don't know session name echo $DESKTOP_SESSION

0

I tried all the things above. Autologin was working but no matter what user I specified in the config file the system used to autologin with a specific user which I was not able to change. Basically I wanted the system to autologin with user X but the system always used to autologin with user Y.

Finally I figured out that the autologin user is being set in the following file:

/etc/sysconfig/displaymanager

Here I had to set the below line to get the autologin to login to my user.

DISPLAYMANAGER_AUTOLOGIN=your_username

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.