KB Article #177209

Failed to connect to sFTP server

Problem

* An sFTP connection made by the API Gateway fails with a trace similar to:

Authentications that can continue: publickey,keyboard-interactive,password
Next authentication method: publickey
Authentications that can continue: keyboard-interactive,password
Next authentication method: keyboard-interactive
Disconnecting from 10.0.0.1 port 22
IO error downloading file to FTP server:

Resolution

-- This indicates that authentication to the sFTP server has failed. If the username and password is correct, it might be because the sFTP server has password authentication disabled. In particular, note that password is a separate scheme from keyboard-interactive authentication, so it might appear that interactive command line tools are able to connect using a 'password' (they're really using keyboard-interactive) where the API Gateway is not able to connect with the very same password.


When the sFTP server is sshd, you should check sshd.conf to see which authentication methods are enabled. The API Gateway is only capable of using 'publickey' and 'password' authentication and the keys use to authenticate have to be properly set up on the server. This can also be confusing, because certain sFTP servers like sshd are very particular about the precise file permissions used for authentication keys and will fail to authenticate keys that are not set up exactly right. Please consult the relevant sFTP server documentation for further information, for example, this tutorial.