Question

When I use WinSCP in Windows to connect to VMware with Ubuntu, it prompted this:

The server rejected SFTP connection, but it listens for FTP connections. Did you want to use FTP protocol instead of SFTP? Prefer using encryption.

What's the matter?
I can succeed to ping Ubuntu in Windows.

Was it helpful?

Solution

The fact that you can ping the server has nothing to do with what protocols it supports.

The message says that the server does not listen on port 22 (SSH, SFTP), but listens on port 21 (FTP). The point of the message is that WinSCP defaults to SFTP protocol, what is not common. So it tries to help users who expect FTP to be a default. But that's not relevant to you apparently.

As @ps2goat suggested, make sure you setup SSH/SFTP server.

For more details, see the documentation for the error message The server rejected SFTP connection, but it listens for FTP connections.

OTHER TIPS

If you see this error all of a sudden (when SFTP has always worked for you for this particular server), and if you are using CSF (ConfigServer Security & Firewall), then it might be that your IP was blocked for SSH access. Try flushing all blocks. Also, try restarting the SSH server.

Old question but still responding so others might get benefited.

I stumbled upon this error and the first thing I checked was if my ubuntu machine had ssh installed. It was there and the latest version and I still would get this error.

As long as you have ssh access to the target, check the ssh service status and most certainly it'd be found inactive. Turn it on using

sudo service ssh restart

and you should be back in the game.

Do check the status of the SFTP by using

sudo service ssh status 

and take any corrective action.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top