I had the same problem as ssh connection to server closed after authentication immediately I connected to my server (in this case a raspberry pi running pi musicbox) via ssh, it would accept my password and then instantly close the connection--long before I might have followed one suggestion to hit ^C.
I am posting this duplicate of that question because I managed to solve my problem, but I am new to this site and don't have 10 rep from this site to post on a "protected" question (despite my "association" bonus of 100 rep based on other stackexchange sites). You can see me whine about this here, where @slm made the constructive suggestion that I submit my own question and answer.
For a bit more context, the default login on the pi musicbox is root; I created another personal login to store my music so that I wouldn't always be logging in as root. I did this with the command:
useradd -c "Joe Schmo" -d /home/jschmo jschmo