Relating to this question about sftping files between Android and OSX, I'd like to know under what conditions an SFTP server responds with 500 SSH-2.0-<client program> not understood. On the OSX command line, I type

sftp -oport=<port> <user>@<ip>

but on the Android side I get

500 SSH-2.0-OPENSSH_7.4 not understood

What configurations do I need to make in order to connect to an SFTP server running on Android?


That's not an SFTP server. That's an FTP server. While the names may be similar, those are two entirely different and unrelated protocols.

  • FTP is a plain line-based protocol.
  • FTPS is "regular" FTP but uses TLS (SSL) as the transport.
  • SFTP uses SSH as the transport, and is very different on the inside as well.

FTP uses plain 4-letter commands (e.g. USER, FEAT) and numeric success/error responses. Meanwhile, all SSH and SFTP clients (and servers) start with a SSH-2.0-[clientname] header and speak a binary protocol afterwards.

Some clients (WinSCP, FileZilla, lftp) support all three, but you must correctly tell them which one to use. The sftp command, meanwhile, is for SFTP only and you cannot use it with a FTP server.

  • Ok, how could it be that I could access this very server with FileZilla via SFTP until recently? – oarfish Apr 14 '17 at 10:10
  • Maybe you had configured FileZilla to use FTP and not SFTP, or maybe the server had protocol auto-detection at some point in time? The fact remains that you're not connecting to a SFTP-compatible server right now. – user1686 Apr 14 '17 at 10:12
  • Using the HTTPS / FTPS / SFTP App for android, I can start a guaranteed SFTP server, but connecting like above results in Unable to negotiate with port 2222: no matching host key type found. Their offer: ssh-dss. What do I need to do for password authentication? I have configured credentials in the server app. – oarfish Apr 14 '17 at 10:15
  • I also can't use the ftp command line client from OSX, the server doesn't even report any attempts in the log. But using ftp instead of sftp form FileZilla appears to work. So your suggestion that FileZilla stopped doing some kind of autodetect seems reasonable. I still don't get why I'm not able to access the SFTP server running on the Computer from Android, however. – oarfish Apr 14 '17 at 10:18
  • FileZilla definitely does not do any protocol autodetection. – Martin Prikryl Apr 14 '17 at 10:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.