Re: SFTP, Remote side unexpectedly closed network connection
@Emma1989: See my answer to @JohnWis above:
I have sent you the modified version only for your "analysis", if you indeed suffer from the referenced problem. It was not meant to be a solution. The solution is to upgrade your OpenSSH installation.