Why Do I Fail to Connect to a Linux ECS Using WinSCP?

Symptom

Connecting to a Linux ECS using WinSCP fails, while using SSH tools like Xshell succeeds.

Figure 1 Connection error using WinSCP

Root Cause

If you can connect to a Linux ECS using SSH tools, the SSH tools run properly. Check the SFTP configuration file because WinSCP allows you to connect your Linux ECS via SFTP protocol.

Run the following command to view the /etc/ssh/sshd_config file:

vi /etc/ssh/sshd_config

Check the SFTP configuration and the configuration file is /usr/libexec/openssh/sftp-server.

Figure 2 SFTP configuration file

If the SFTP configuration file does not exist or the file permission is not 755, connecting to a Linux ECS using WinSCP will fail.

Solution