Symptoms
Unable to connect to SFTP. The following error is shown in an FTP client:
Received unexpected end-of-file from SFTP server
Cause
Incorrect value of the Subsystem parameter in the SSH configuration:
# grep Subsystem /etc/ssh/sshd_config
Subsystem sftp /usr/libexec/openssh/sftp-server
Resolution
-
Connect to the server via SSH
-
Replace the necessary value:
# for i in $(grep Subsystem /etc/ssh/sshd_config | awk '{print $3}'); do sed -i 's|'"$i"'|external-sftp|g' /etc/ssh/sshd_config; done
-
Reload the SSHD service:
# service sshd reload