Unable to log in to Pi

This is not a special Node-RED question, but I hope somebody may know the answer. I set my Pi up with a strong password because there’s several people getting access to the house during the summer, when I rent out to tourists. And suddenly I’m unable to log in! I get to the longin screen and write the correct password, but it just jumps back to the login screen after some seconds. I can log in with command line (alt + control + F6), but doing startx doesn’t work. First it complains about a timeout locking authority file (xauthority), and then it all goes black. I have of course tried to delete the file, but that didn’t help. I can still use the automation since that is started before a GUI login, but I really need to upgrade stuff (after finding an erorr in another thread).

The dumb thing is that it happened right after I tried to take a backup with the SDCard copier that failed, I actually did a reboot to see if that helped! So the backup is messed up too… I have of course mounted the SD card in another Pi and copied the full contents of my Pi directory (with all the automation stuff) to a share on my Windows server. But it would be nice to get access to it, even if I can copy the automation stuff over to a copy of one of my other production Pi’s. I just had this one set up for an exact thing, and it will be a pain to modify the other image. Does anybody have good ideas?

Maybe this could help

https://raspberrypi.stackexchange.com/questions/45914/raspbian-graphical-login-screen-stuck-cant-login

That’s one of the placves I have been, but it didn’t help. I didn’t dare to mess everything up, as in the last part of the answer because I need it to run until I have a replacement ready.

That is the craziest thing I’ve seen! It has actually logged into the GUI by itself during the night! Seriously! I really, really, really have no idea what’s going on with that! Well, as long as it works, I’m not going to mess with it…

Edit: I see in the configuration that it’s set to auto login again (and I had set it not to autologin). Maybe one of the files I deleted contained that info, so it went back to the default setting after I had given up on it the last time, and when I plugged it in to use Node-RED and Home Assistnat it quietly logged in. I guess that’s a better theory than my first, which was (as always) gremlins in the system.