Linux – SFTP and FileZilla – Connection closed by server with exitcode 128

debianftplinuxsftpwinscp

This was working well until a couple of days ago. I can't recall having done anything to the server leading it to start closing the connection. Also I have no idea what exitcode 128 means, and can't find anything about it. Here's FileZilla's response to the connection attempt

Status: Connecting to foo.bar.no...
Response:   fzSftp started
Command:    open "root@foo.bar.no" 22
Command:    Pass: *******
Status: Connected to foo.bar.no
Error:  Connection closed by server with exitcode 128
Error:  Could not connect to server

Trying to connect with WinSCP also tells me the server closed the connection with error code 128 and additionally tells me:

Cannot initialize SFTP protocol. Is the host running a SFTP server?

I can SSH connect to the server no problem using PuTTY. Any ideas?

Best Answer

It might be an invalid .bashrc file. In my case I found it was referencing another recently deleted script, and so failed.