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

Posted July 13, 2015 259.7k views
CentOSApachePHPLAMP StackDigitalOceanDNSMariaDB

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.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
7 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
  • 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
  • This did not work for me. Instead, it caused the server to reject any remote access. I had to access it through the console. Instead of this, one can temporarily change the permissions or ownership for whatever file/directory is needed.

    System: Ubuntu 16.04 LTS

        Hi, my answer is this: The DigitalOcean for security reasons if you made a droplet just right now or reseted root password and you want to login to the VPS via FTP Connection you should before connecting to your SSH Console and log in and then change your password(In your SSH you will see Enter Unix Password and then Enter New Password so you will see...) .
        Then with the new password you can log in via FTP...
         Hope this helps, my problem has been solved since I did this.

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.

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.

from my CentOS 7.3 minmal -> G R E A T !

Thanks sth, your solution works fine.

Solved - Logged into WHM and enabled shell access for that account.