Why do I get an Unexpected EOF error when using SFTP?
I can't connect to my Linode using either Putty or Filezilla. I get this error from FileZilla when attempting to connect:
Status: Connecting to example.com...
Response: fzSftp started, protocol_version=8
Command: keyfile "C:\Path\To\SSH_files\id_rsa.ppk"
Command: open "example@example.com" 22
Status: Connected to example.com
Error: Received unexpected end-of-file from SFTP server
Error: Could not connect to server
1 Reply
This error can be a bit frustrating, largely due to the fact that it's not very specific, and can indicate a number of different issues. The one thing it does tell us for sure is that something is off in the configuration of SSH/SFTP.
SSH/SFTP are both part of the same service (SSH), and the server-side configuration happens via the file /etc/sshd/sshd_config
. This error most likely indicates that something is wrong in this file, although it's hard to say what without being able to view its contents.
I recommend that you start troubleshooting by trying to connect to SSH in verbose mode, in the hopes that we can get a more specific error message. From the command line, you can run the following, replacing $USER
with the username for your Linode, and $ADDRESS
with either the IP address or DNS name for the Linode:
ssh -vvv $USER@$ADDRESS
I've included FileZilla's Logging instructions, which talks about getting more verbose output from FileZilla, as well as the same for PuTTY.
That will hopefully give you a better idea of what the specific error is, at which point you can modify your /etc/sshd/sshd_config
accordingly.
If it does not get you to a more specific error, then you can either go line by line through the file, verifying the correct syntax and entries for everything, or you can check out our guide on Troubleshooting SSH, as well as this post, which covers troubleshooting common issues with SSH.