Recently the server running SFTP was updated with some security patches applied. Soon afterwards, one of the users couldn't connect via SFTP with the following error:
$ sftp broken_user@server
Received message too long 1936094320
I spent quite a bit of time searching for solutions and most talked about an echo statement in one of the .bashrc or .bash_profile scripts. However, upon inspection I couldn't find any echo statements.
However, I noticed that when I used the root user it worked fine:
$ sftp root@server
I did manage to find a workaround, although I am still unable to explain why it works.
I ended up editing the /etc/passwd file and changed a line from: