Login Loop for Guest Session

BeckBjo

New Member
Credits
60
Hi,
I'm facing a login loop for the guest session. After selecting the guest session, and hitting enter, system returns to the logon screen.
Different to all other post I found, only the guest session is affected. Normal user login succeeds.

Guest session worked for years in 18.04. (and prior) and just stoped working today/yesterday. I can not tell what caused the change. I have not updated the distro.

Distro and version: Xubuntu 18.04.5 LTS. (XFCE)
Kernel: 5.4.0-66-generic
Display Manager: lightdm

What I tried so far is
- disabling and reenabling the guest session via /etc/lightdm/lightdm.conf.d/40-enable-guest.conf
- removing everything in /etc/guest-session/

This is the /var/log/lightdm/lightdm.log:
[+4833.96s] DEBUG: Greeter connected version=1.26.0 api=1 resettable=false
[+4834.21s] DEBUG: Greeter start authentication for USER
[+4834.21s] DEBUG: Session pid=4249: Started with service 'lightdm', username 'USER'
[+4834.22s] DEBUG: Session pid=4249: Got 1 message(s) from PAM
[+4834.22s] DEBUG: Prompt greeter with 1 message(s)
[+4845.75s] DEBUG: Greeter start authentication for guest account
[+4845.75s] DEBUG: Session pid=4249: Sending SIGTERM
[+4845.75s] DEBUG: Session pid=4249: Terminated with signal 15
[+4845.75s] DEBUG: Session: Failed during authentication
[+4845.75s] DEBUG: Seat seat0: Session stopped
[+4846.25s] DEBUG: Ignoring set language request for guest user
[+4846.27s] DEBUG: Greeter requests session xubuntu
[+4846.27s] DEBUG: Seat seat0: Stopping greeter; display server will be re-used for user session
[+4846.27s] DEBUG: Terminating login1 session c3

[+4846.28s] DEBUG: Session pid=4146: Sending SIGTERM
[+4846.28s] DEBUG: Session pid=4146: Exited with return value 0
[+4846.28s] DEBUG: Seat seat0: Session stopped
[+4846.28s] DEBUG: Seat seat0: Greeter stopped, starting session authentication
[+4846.28s] DEBUG: Opening guest account with command '/usr/sbin/guest-account add'
[+4846.32s] DEBUG: Guest account setup script returns 256:
[+4846.32s] DEBUG: Seat seat0: Failed to start session, starting greeter

[+4846.32s] DEBUG: Seat seat0: Creating greeter session
[+4846.32s] DEBUG: Session pid=4265: Started with service 'lightdm-greeter', username 'lightdm'
[+4846.32s] DEBUG: Seat seat0: Session stopped
[+4846.32s] DEBUG: Seat seat0 changes active session to
[+4846.33s] DEBUG: Session pid=4265: Authentication complete with return value 0: Success
[+4846.33s] DEBUG: Seat seat0: Session authenticated, running command
[+4846.33s] DEBUG: Launching process 4268: xubuntu-numlockx
[+4846.45s] DEBUG: Process 4268 exited with return value 0
[+4846.45s] DEBUG: Seat seat0: Exit status of xubuntu-numlockx: 0
[+4846.45s] DEBUG: Session pid=4265: Running command /usr/lib/lightdm/lightdm-greeter-session /usr/sbin/lightdm-gtk-greeter
[+4846.45s] DEBUG: Creating shared data directory /var/lib/lightdm-data/lightdm
[+4846.45s] DEBUG: Session pid=4265: Logging to /var/log/lightdm/seat0-greeter.log
[+4846.53s] DEBUG: Activating VT 7
[+4846.53s] DEBUG: Activating login1 session c4
[+4846.53s] DEBUG: Seat seat0 changes active session to c4
[+4846.53s] DEBUG: Session c4 is already active
[+4846.63s] DEBUG: Greeter connected version=1.26.0 api=1 resettable=false
[+4846.88s] DEBUG: Greeter start authentication for guest account
[+4853.45s] DEBUG: Ignoring set language request for guest user
[+4853.49s] DEBUG: Greeter requests session xubuntu
[+4853.49s] DEBUG: Seat seat0: Stopping greeter; display server will be re-used for user session
[+4853.49s] DEBUG: Terminating login1 session c4
[+4853.49s] DEBUG: Session pid=4265: Sending SIGTERM
[+4853.50s] DEBUG: Greeter closed communication channel
[+4853.50s] DEBUG: Session pid=4265: Exited with return value 0
[+4853.50s] DEBUG: Seat seat0: Session stopped
[+4853.50s] DEBUG: Seat seat0: Greeter stopped, starting session authentication
[+4853.50s] DEBUG: Opening guest account with command '/usr/sbin/guest-account add'
[+4853.54s] DEBUG: Guest account setup script returns 256:
[+4853.54s] DEBUG: Seat seat0: Failed to start session, starting greeter
[+4853.54s] DEBUG: Seat seat0: Creating greeter session
[+4853.54s] DEBUG: Session pid=4383: Started with service 'lightdm-greeter', username 'lightdm'
[+4853.54s] DEBUG: Seat seat0: Session stopped
[+4853.54s] DEBUG: Seat seat0 changes active session to
[+4853.56s] DEBUG: Session pid=4383: Authentication complete with return value 0: Success
[+4853.56s] DEBUG: Seat seat0: Session authenticated, running command
[+4853.56s] DEBUG: Launching process 4386: xubuntu-numlockx
[+4853.67s] DEBUG: Process 4386 exited with return value 0
[+4853.67s] DEBUG: Seat seat0: Exit status of xubuntu-numlockx: 0
[+4853.67s] DEBUG: Session pid=4383: Running command /usr/lib/lightdm/lightdm-greeter-session /usr/sbin/lightdm-gtk-greeter
[+4853.67s] DEBUG: Creating shared data directory /var/lib/lightdm-data/lightdm
[+4853.67s] DEBUG: Session pid=4383: Logging to /var/log/lightdm/seat0-greeter.log
[+4853.76s] DEBUG: Activating VT 7
[+4853.76s] DEBUG: Activating login1 session c5
[+4853.76s] DEBUG: Seat seat0 changes active session to c5
[+4853.76s] DEBUG: Session c5 is already active
[+4853.86s] DEBUG: Greeter connected version=1.26.0 api=1 resettable=false
[+4854.11s] DEBUG: Greeter start authentication for guest account
[+4862.37s] DEBUG: Ignoring set language request for guest user
[+4862.41s] DEBUG: Greeter requests session xubuntu
[+4862.41s] DEBUG: Seat seat0: Stopping greeter; display server will be re-used for user session
[+4862.41s] DEBUG: Terminating login1 session c5
[+4862.42s] DEBUG: Session pid=4383: Sending SIGTERM
[+4862.42s] DEBUG: Session pid=4383: Exited with return value 0
[+4862.42s] DEBUG: Seat seat0: Session stopped
[+4862.42s] DEBUG: Seat seat0: Greeter stopped, starting session authentication
[+4862.42s] DEBUG: Opening guest account with command '/usr/sbin/guest-account add'
[+4862.46s] DEBUG: Guest account setup script returns 256:
[+4862.46s] DEBUG: Seat seat0: Failed to start session, starting greeter
[+4862.46s] DEBUG: Seat seat0: Creating greeter session
Any advice is greatly appriciated.
Thanks.
 
Last edited:


wizardfromoz

Super Moderator
Staff member
Gold Supporter
Credits
13,559
G'day @BeckBjo and welcome to linux.org :)

On the face of it, it appears you have made some educated efforts to resolve the problem.

I don't know if this article here might be of assistance?

https://techsphinx.com/linux/fix-ubuntu-login-loop/

But if not, I am all for workarounds and I wonder whether you are aware that support for Xubuntu 18.04 ends around end of April.

You might be better served by installing Xubuntu 20.04 now.

BTW if you had installed Timeshift, you would be able to roll back to when it was working, and work from there to eliminate the fly in the ointment.

If you have any questions on Timeshift, see me at

https://www.linux.org/threads/timeshift-similar-solutions-safeguard-recover-your-linux.15241

Someone else may have a better suggestion.

Cheers

Chris Turner
wizardfromoz
 

BeckBjo

New Member
Credits
60
Thanks for your response Chris,

the article did not help me much (maybe my lack of understanding), it talks about the login loop for the regular user account. This is pretty much what I found everywhere else and what I referred to in my first post: these articles talk about wrong ownership of .Xauthority or missing permissions to /temp. But I don't know how to apply that to the guest session (guest account).

I get your point about 18.04 supoprt ending, but I'd still like to understand what the heck happend and how to fix it.

Any further suggestions on how to track down the issue?

Kind Regards,
Björn
 

Lord Boltar

Active Member
Credits
2,427
you can delete your .Xauthority from your directory and then reboot your machine - it is probably owned by root - it should write a new one - then try again
Note - you may have to be in root to delete the file
to access root in Thunar
Code:
pkexec thunar
 

BeckBjo

New Member
Credits
60
you can delete your .Xauthority from your directory and then reboot your machine - it is probably owned by root - it should write a new one - then try again
Note - you may have to be in root to delete the file
to access root in Thunar
Code:
pkexec thunar
.Xauthority was owned by the user as it should be. After removing it, the system created a new one.
login loop for guest session remains =(
 

BeckBjo

New Member
Credits
60
When I executed sudo /usr/sbin/guest-account add it returns:
useradd: Can't get unique GID (no more available GIDs)
useradd: can't create group
It should in fact return the user ID, something like guest-xxxxxx

I do see close to 900 guest user IDs in /etc/shadow, /etc/group, /etc/passwd and so forth

Turns out the number of guest IDs and groups is controlled by the file /etc/login.defs
# Min/max values for automatic uid selection in useradd
#
UID_MIN 1000
UID_MAX 60000
# System accounts
#SYS_UID_MIN 100
#SYS_UID_MAX 999
#
# Min/max values for automatic gid selection in groupadd
#
GID_MIN 1000
GID_MAX 60000
# System accounts
#SYS_GID_MIN 100
#SYS_GID_MAX 999
the lines are commented, but I assume a default applies which are the same numbers. Hence I ran into problems after 899 guest sessions.

You can allow for more guest uid's (and groups) by uncommenting SYS_UID_MAX and SYS_GID_MAX and setting to a larger number.

I still wonder, is there a way to remain with the default /etc/login.defs and instead remove the guest account uids collected over the years? I'd much prefer getting rid of the garbage!

E.g. what I could image is
Code:
for every string STRG that matches guest-* in /etc/passwd
sudo userdel STRG
Any advice is greatly appriciated!
Thanks,
Björn
 
Last edited:

Lord Boltar

Active Member
Credits
2,427
List all users with a /home folder:
Code:
awk -F: '/\/home/ {printf "%s:%s\n",$1,$3}' /etc/passwd
or all users with a UID >= 1000:
Code:
awk -F: '($3 >= 1000) {printf "%s:%s\n",$1,$3}' /etc/passwd
 

BeckBjo

New Member
Credits
60
Cheers Lord Boltar,

that was good advice. My guest users in /etc/passwd can not be descriminated from regular users by the Id scheme. But awk still does the job (the first part of it)

This gets me the IDs of all users which are of type Guest:
Code:
gawk -F: '($5 =="Guest") { print $1 }' /etc/passwd
Output:
guest-plvvcc
guest-ktnau7
guest-9vbdgs
...
I can now use this list to run my for loop in bash script:
Bash:
#!/bin/bash

# cleans up previous Guest-Sessions by removing all users of type Guest listed in /etc/passwd"

guestUserList=$(gawk -F: '($5 =="Guest") { print $1 }' /etc/passwd)

for user in $guestUserList
do 
userdel $user
done

unset guestUserList
 
Last edited:

BeckBjo

New Member
Credits
60
should lightdm not invoke /usr/sbin/guest-account remove when the guest session terminates?

just as it invokes /usr/sbin/guest-account add when the guest session starts?

Arguements are:
1) Firstly, this would prevent the issue that at some point all user IDs are used up and the /etc/passwd and so forth are full of garbe.
2) Secondly, the guest session should be temporary and leave no trace on the system.

issue filed on https://github.com/canonical/lightdm/issues/179

Many thanks and best regards,
Björn
 
Last edited:
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Members online


Latest posts

Top