[Solved] Stuck in loop asking for password before desktop. Check your .profile
This is the second time I've had this problem. Last time I gave up and rebuilt from a new download of Rasbian.
Expected functionality: Pi3 (Raspbian, Stretch, up to date) is set to "Boot to desktop". When I turn on I get to the desktop and can do stuff. No password required. I have been using the pi this way since 23rd August with no problems whatsoever.
Symptoms after a reboot today - different to every other reboot I've done:
1) Through SSH I can log in using default word "raspberry".
2) When connected to HDMI/keyboard/mouse instead getting to the desktop I get to a login prompt for pi on desktop screen3)
3) If I enter the correct password "raspberry" I get a black screen and then the login prompt comes back
4) If I enter an incorrect password deliberately it tells me, correctly, that I got it wrong.
5) Over SSH I added a new user with useradd, and using that user I can login successfully to the desktop at the login prompt .
6) Over SSH I changed the password for user pi, however when I try to use that to get to the desktop I get the symptoms in 3 above.
Please can someone help me find out what has gone wrong and how to correct it so that I can log in as "pi"?
If this has happened to me twice, it seems likely that this is probably happening to other people.