# Auto-LogIn mit Systemd (lightdm)

## flammenflitzer

Hallo, zu Zeiten von openrc hatte ich mir Auto-LogIn ohne Displaymanager eingerichtet. Das hat mit systemd nicht mehr funktioniert. Da habe ich sddm genommen. Der funktioniert nicht mehr (obwohl sddm-greeter --test-mode ohne Probleme funktioniert). Jetzt nutze ich Lightdm. Hier habe ich in der /etc/lightdm/lightdm-gtk-greeter.conf

```
autologin-user=olaf

autologin-user-timeout=0
```

 hinzugefügt. Aber das funktioniert nicht.  :Confused: 

Gibt es die Möglichkeit mit systemd Auto-LogIn ohne DM? Muss der o.g. Eintrag in die lightdm.conf statt lightdm-gtk-greeter.conf?

----------

## flammenflitzer

Der Fehler scheint an anderer Stelle zu liegen. Ich habe lightdm-1.28.0

```
$ cat /etc/lightdm/lightdm-gtk-greeter.conf | grep auto

autologin-guest=false

autologin-user=olaf

autologin-user-timeout=0
```

und 

```
$ cat /etc/lightdm/lightdm.conf | grep auto | grep -v \#

autologin-guest=false

autologin-user=olaf

autologin-user-timeout=0
```

 sowie sddm-0.15.0 

```
$ cat /etc/sddm.conf.d/kde_settings.conf 

[Autologin]

Relogin=false

Session=plasma

User=olaf
```

 ausprobiert. Nichts funktioniert. Wobei ich festgestellt habe, das es bei sddm unterschiedliche Ansätze gibt. Bei mir existiert die Datei 

```
/etc/sddm.conf.d/kde_settings.conf
```

Hier https://www.mankier.com/5/sddm.conf und beim UbuntuWiki wird für Auto LogIn die Datei 

```
/etc/sddm.conf
```

verwendet. Beim ArchWiki 

```
/etc/sddm.conf.d/autologin.conf
```

  :Confused: 

----------

## flammenflitzer

Zumindest für sddm-0.15.0. habe ich die Lösung gefunden. Ich habe zur Konfiguration sddm-kcm benutzt. Dabei wird die Datei /etc/sddm.conf.d/kde_settings.conf angelegt. sddm scheint diese nicht zu nutzen (wahrscheinlich werden nur /etc/sddm.conf und /usr/share/sddm/sddm.conf.d/00default.conf ausgewertet). Ich habe die /etc/sddm.conf bearbeitet und hier funktioniert Auto LogIn. Ich denke, man sollte dann die /usr/share/sddm/sddm.conf.d/00default.conf auf /etc/sddm.conf.d/kde_settings.conf verlinken.

----------

## franzf

man sddm.conf:

```
SYNOPSIS

       Configuration loads all files in the configuration directories followed by the configuration file in the order listed below with the latter having the most precedent. Changes should be made to the local configura‐

       tions.

       /usr/lib/sddm/sddm.conf.d

              System configuration directory

       /etc/sddm.conf.d

              Local configuration directory

       /etc/sddm.conf

              Local configuration file for compatibility
```

/etc/sddm.conf wird nach den ganzen anderen Dateien ausgewertet und ersetzt mögliche Konfigurationen aus local conf dir und system conf dir. Wenn du in /etc/sddm.conf Autologin deaktivierst bringt es nichts, wenn es in /etc/sddm.conf.d/kde.conf aktiviert ist.

----------

## flammenflitzer

Ich hatte es in der /etc/sddm.conf nicht deaktiviert. Nur nicht explizit aktiviert. Und wenn ich es in beiden Dateien aktivieren muss, ist doch eine überflüssig. PS: In der Vergangenheit habe ich die /etc/sddm.conf nie anpassen müssen. Ich habe die Einstellungen immer mit sddm-kcm vorgenommen.

----------

## flammenflitzer

Nachdem ssdm schon wieder nicht mehr funktioniert, habe ich lightdm in Benutzung. Allerdings funktioniert autologin nicht. 

```
cat /etc/lightdm/lightdm.conf 

[LightDM]

autologin-guest = false

autologin-user = olaf

autologin-user-timeout = 0

autologin-session = plasma

[Seat:*]

session-wrapper=/etc/lightdm/Xsession

[XDMCPServer]

[VNCServer]
```

```

cat /etc/lightdm/lightdm-gtk-greeter.conf

[greeter]

background=/usr/share/lightdm/backgrounds/gentoo-bg_65.jpg

theme-name=Adwaita

icon-name=gnome

cursor-name=gnome

font-name=Cantarell 11

xft-antialias=true

xft-dpi=96

xft-hintstyle=hintslight

xft-rgba=rgb

autologin-guest=false

autologin-user=olaf

autologin-user-timeout=0

indicators=~host;~spacer;~clock;~spacer;~session;~language;~a11y;~power;~
```

```
cat /var/log/lightdm/lightdm.log   

[+0.00s] DEBUG: Logging to /var/log/lightdm/lightdm.log

[+0.00s] DEBUG: Starting Light Display Manager 1.30.0, UID=0 PID=3437

[+0.00s] DEBUG: Loading configuration dirs from /usr/share/lightdm/lightdm.conf.d

[+0.00s] DEBUG: Loading configuration dirs from /usr/local/share/lightdm/lightdm.conf.d

[+0.00s] DEBUG: Loading configuration dirs from /etc/xdg/lightdm/lightdm.conf.d

[+0.00s] DEBUG: Loading configuration from /etc/lightdm/lightdm.conf

[+0.00s] DEBUG:   [LightDM] contains unknown option autologin-guest

[+0.00s] DEBUG:   [LightDM] contains unknown option autologin-guest

[+0.00s] DEBUG:   [LightDM] contains unknown option autologin-user

[+0.00s] DEBUG:   [LightDM] contains unknown option autologin-user-timeout

[+0.00s] DEBUG:   [LightDM] contains unknown option autologin-session

[+0.00s] DEBUG: Registered seat module local

[+0.00s] DEBUG: Registered seat module xremote

[+0.00s] DEBUG: Using D-Bus name org.freedesktop.DisplayManager

[+0.00s] DEBUG: _g_io_module_get_default: Found default implementation local (GLocalVfs) for ‘gio-vfs’

[+0.49s] DEBUG: Monitoring logind for seats

[+0.49s] DEBUG: New seat added from logind: seat0

[+0.49s] DEBUG: Seat seat0: Loading properties from config section Seat:*

[+0.49s] DEBUG: Seat seat0 has property CanMultiSession=no

[+0.49s] DEBUG: Seat seat0: Starting

[+0.49s] DEBUG: Seat seat0: Creating greeter session

[+0.49s] DEBUG: Seat seat0: Creating display server of type x

[+0.49s] DEBUG: posix_spawn avoided (fd close requested) 

[+0.49s] DEBUG: Could not run plymouth --ping: Failed to execute child process “plymouth” (No such file or directory)

[+0.49s] DEBUG: Using VT 7

[+0.49s] DEBUG: Seat seat0: Starting local X display on VT 7

[+0.49s] DEBUG: XServer 0: Logging to /var/log/lightdm/x-0.log

[+0.49s] DEBUG: XServer 0: Writing X server authority to /var/run/lightdm/root/:0

[+0.49s] DEBUG: XServer 0: Launching X Server

[+0.49s] DEBUG: Launching process 3496: /usr/bin/X :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch

[+0.49s] DEBUG: XServer 0: Waiting for ready signal from X server :0

[+0.49s] DEBUG: Acquired bus name org.freedesktop.DisplayManager

[+0.49s] DEBUG: Registering seat with bus path /org/freedesktop/DisplayManager/Seat0

[+0.65s] DEBUG: Loading users from org.freedesktop.Accounts

[+0.65s] DEBUG: User /org/freedesktop/Accounts/User500 added

[+0.67s] DEBUG: User /org/freedesktop/Accounts/User1000 added

[+0.72s] DEBUG: posix_spawn avoided (automatic reaping requested) (fd close requested) 

[+1.71s] DEBUG: Got signal 10 from process 3496

[+1.71s] DEBUG: XServer 0: Got signal from X server :0

[+1.71s] DEBUG: XServer 0: Connecting to XServer :0

[+1.71s] DEBUG: posix_spawn avoided (fd close requested) (child_setup specified) 

[+1.71s] DEBUG: Seat seat0: Display server ready, starting session authentication

[+1.71s] DEBUG: Session pid=3536: Started with service 'lightdm-greeter', username 'root'

[+1.78s] DEBUG: Session pid=3536: Authentication complete with return value 0: Success

[+1.78s] DEBUG: Seat seat0: Session authenticated, running command

[+1.78s] DEBUG: Session pid=3536: Running command /usr/sbin/lightdm-gtk-greeter

[+1.78s] DEBUG: Creating shared data directory /var/lib/lightdm-data/root

[+1.78s] DEBUG: Session pid=3536: Logging to /var/log/lightdm/seat0-greeter.log

[+1.93s] DEBUG: Activating VT 7

[+1.93s] DEBUG: Activating login1 session 1

[+1.93s] DEBUG: Seat seat0 changes active session to 1

[+1.93s] DEBUG: Session 1 is already active

[+2.02s] DEBUG: Greeter connected version=1.30.0 api=1 resettable=false

[+2.50s] DEBUG: Greeter start authentication for olaf

[+2.50s] DEBUG: Session pid=3571: Started with service 'lightdm', username 'olaf'

[+2.50s] DEBUG: Session pid=3571: Got 1 message(s) from PAM

[+2.50s] DEBUG: Prompt greeter with 1 message(s)

[+22.70s] DEBUG: Continue authentication

[+25.02s] DEBUG: Session pid=3571: Authentication complete with return value 6: Permission denied

[+25.02s] DEBUG: Authenticate result for user olaf: Permission denied

[+25.02s] DEBUG: Session pid=3571: Exited with return value 1

[+25.02s] DEBUG: Seat seat0: Session stopped

[+25.02s] DEBUG: Greeter start authentication for olaf

[+25.02s] DEBUG: Session pid=3582: Started with service 'lightdm', username 'olaf'

[+25.03s] DEBUG: Session pid=3582: Got 1 message(s) from PAM

[+25.03s] DEBUG: Prompt greeter with 1 message(s)

[+29.41s] DEBUG: Continue authentication

[+29.47s] DEBUG: Session pid=3582: Authentication complete with return value 0: Success

[+29.47s] DEBUG: Authenticate result for user olaf: Success

[+29.47s] DEBUG: User olaf authorized

[+29.51s] DEBUG: Greeter sets language de_DE.utf8

[+29.62s] DEBUG: Greeter requests session plasma

[+29.62s] DEBUG: Seat seat0: Stopping greeter; display server will be re-used for user session

[+29.62s] DEBUG: Terminating login1 session 1

[+29.63s] DEBUG: Session pid=3536: Sending SIGTERM

[+29.64s] DEBUG: Greeter closed communication channel

[+29.64s] DEBUG: Session pid=3536: Exited with return value 0

[+29.64s] DEBUG: Seat seat0: Session stopped

[+29.64s] DEBUG: Seat seat0: Greeter stopped, running session

[+29.64s] DEBUG: Registering session with bus path /org/freedesktop/DisplayManager/Session0

[+29.64s] DEBUG: posix_spawn avoided (fd close requested) (child_setup specified) 

[+29.64s] DEBUG: Session pid=3582: Running command /etc/lightdm/Xsession /usr/bin/startplasma-x11

[+29.64s] DEBUG: Creating shared data directory /var/lib/lightdm-data/olaf

[+29.64s] DEBUG: Session pid=3582: Logging to .xsession-errors

[+29.79s] DEBUG: Activating VT 7

[+29.79s] DEBUG: Activating login1 session 3

[+29.79s] DEBUG: Seat seat0 changes active session to 

[+29.79s] DEBUG: Seat seat0 changes active session to 3

[+29.79s] DEBUG: Session 3 is already active
```

PS: plymouth habe ich nicht installiert.

----------

## firefly

 *Quote:*   

> [+0.00s] DEBUG: Loading configuration from /etc/lightdm/lightdm.conf
> 
> [+0.00s] DEBUG:   [LightDM] contains unknown option autologin-guest
> 
> [+0.00s] DEBUG:   [LightDM] contains unknown option autologin-guest
> ...

 

Da ist das problem. Die verwendete optionen sind unbekannt in der lightdm version welche du installiert hast.

----------

## flammenflitzer

Eine "jungfräuliche config

```
# cat /etc/lightdm/lightdm.conf | grep autologin

# pam-autologin-service = PAM service to use for autologin

# autologin-guest = True to log in as guest by default

# autologin-user = User to log in with by default (overrides autologin-guest)

# autologin-user-timeout = Number of seconds to wait before loading default user

# autologin-session = Session to load for automatic login (overrides user-session)

# autologin-in-background = True if autologin session should not be immediately activated

#pam-autologin-service=lightdm-autologin

#autologin-guest=false

#autologin-user=

#autologin-user-timeout=0

#autologin-in-background=false

#autologin-session=
```

 Die Optionen sind enthalten, also sollten sie auch bekannt sein. Ich habe übrigens beide Varianten Beispiel

```
autologin-user=olaf

autologin-user = olaf
```

ausprobiert.

----------

