I stumbled upon this on my new job. Users complained that they could not login to the server with winscp. The error was:
Received too large SFTP packet.
Then I found a quick fix by choosing another protocol. But after a while I realized that even scp from one server to another was not working. The problem was that the login script (.bashrc) had some output. After a little more digging, I found this link. Basically the problem was that that the output scripts should not be put in .bashrc but in .bash_profile. From the man bash page:
The personal initialization file, executed for login shells
The individual per-interactive-shell startup file
After moving the script that did the output from .bashrc to .bash_profile everything worked perfectly. Hope this helps somebody!