18

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?

Stephen Kitt
  • 411,918
  • 54
  • 1,065
  • 1,164
alle_meije
  • 559
  • 2
  • 5
  • 16

6 Answers6

21

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
madeddie
  • 703
  • 3
  • 10
  • 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.
    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 '16 at 19:49
  • ok, so, it does work in the end with some tweaking? – madeddie Aug 11 '16 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 '16 at 19:55
  • yeah, so those are 2 different things, the autologin group and the nopasswdlogin group, did you add yourself to the nopasswdlogin group before making the changes to PAM? – madeddie Aug 11 '16 at 19:59
  • I did both things and then rebooted. But then none of my passwords, or root, were accepted. But with that undone, the lines in your answer, even though they're accepted and X starts, require me to type a password. I expected to go straight to the session. Could it be the `greeter` thing? I cannot leave the line out (X doesn't start) but maybe it needs another value. – alle_meije Aug 11 '16 at 20:11
  • 1
    i'm at a loss actually and sadly don't have an xfce system i can easily test on – madeddie Aug 11 '16 at 20:13
  • 1
    Successfully configured auto login for Debian 10 with these instructions. – Heinrich Ulbricht Oct 29 '19 at 21:15
  • This worked for me on Debian 10 XFCE. I did not uncomment any other line and several other solutions did not work for me. Seems `greeter-session` & `session-wraper` like this are a must have. – user136036 Nov 23 '19 at 14:13
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
Jeff Schaller
  • 66,199
  • 35
  • 114
  • 250
sploit
  • 89
  • 1
  • 1
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)

scrat.squirrel
  • 303
  • 2
  • 7
David Grayson
  • 191
  • 1
  • 3
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!

alle_meije
  • 559
  • 2
  • 5
  • 16
  • 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 '18 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 '18 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

Marcin
  • 21
  • 1
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
vishal
  • 111
  • 1
  • 5