SFTP login error: fatal error: received unexpected end of file from SFTP server

STFP suddenly failed to log in, no restart, no configuration change, and suddenly an error was reported
ERROR: Received unexpected end-of-file from SFTP server
ERROR: unable to connect to server
status: waiting for retry…

The first possibility:
Password expired, change password, verify this problem, just su (SFTP username) on the server, for example: su Test

If the password prompt has expired, directly change the password, you can log in
Change password command
1. Switch to SFTP user: Su Test
2. Enter the old password for Test
3. Press the prompt to enter a new password. Don’t repeat the old password
Suggestion: The password expiration time can be changed, the default is 90 days, we can change a little longer
 
The second possibility:
Modify the configuration file and remember to back up the file
1. The vi/etc/SSH/sshd_config
Delete the Subsystem SFTP/usr/libexec/openssh/SFTP – “#” in front of the server,
Save the exit and restart SSH
# service SSHD restart
Then reconnect to the FTP test.
 

Read More: