SFTP Connection Error Received unexpected end-of-file from SFTP server

July 13, 2015 37.3k views
DigitalOcean PHP LAMP Stack MariaDB Apache DNS CentOS

Hi, I was be able to connect my server via filezilla till today. I installed lamp and configured dns server after that I'm unable to access to my server via sftp. It say's
Received unexpected end-of-file from SFTP server

  • I seem to be having the same issue. SFTP through Filezilla was working perfectly a couple days ago. Then I updated to a newer version and it is no longer able to connect. Been scouring the internet all evening looking for a solution, any suggestions would be greatly appreciated.

  • yeah I've done that update too. I think for now you should use WinSCP as ftp client

  • Same issue with filezilla and cyberduck.

4 Answers

Fattur, I was able to solve my issue by logging into SSH and editing the sshd_config file:

sudo nano /etc/ssh/sshd_config

Then scroll down until you see this line:

# Subsystem sftp /usr/lib/openssh/sftp-server

Leave that line commented out, but underneath it write this:

Subsystem sftp internal-sftp

Then power cycle your server and the problem should be fixed. I'm now using the latest version of Filezilla without any issues.

  • I had this and i commented out and wrote the line you gave but no fix. filezilla still cannot connect.

    Subsystem   sftp    /usr/libexec/sftp-server
    Subsystem sftp internal-sftp
  • Thanks! this helped.

  • Good call. Not sure why this works for FileZilla but it does. Also, you don't need to power cycle your server, just service sshd restart works fine.

    As a note: You may need to change/add the ForceCommand in the user/group match block to use internal-sftp as well:

    Match User someuser
        ..... other stuff .....
        ForceCommand internal-sftp

Check our filezilla settings if you got anything weird configurated in there like proxy, and check if you are using passive mode. You could also try to use WinSCP client to check if that works

  • Thank's WinSCP connect's to it. But Filezilla doesn't and i checked the the settings and I couldn't see anything weird.

I had the same issue. It got resolved after I logged into console and changed the password from the generated one @ reset email.

See if it helps.

Thanks sth, your solution works fine.

Have another answer? Share your knowledge.