Error: Unable to Connect to SFTP Server - Authentication Error
Issue
Syncs fail with the following error:
Unable to connect to SFTP server. Authentication error - Check your username and password.
Environment
- Connector: SFTP
- Authentication method: Username and password or keypair
Resolution
Follow the steps for the authentication method configured on your SFTP server.
Username and password authentication
Ensure Login with keypair? is disabled:
i. In Fivetran, go to your SFTP connection page.
ii. Select the Settings tab.
iii. Click Edit connection.
iv. Set the Login with keypair? toggle to OFF.
v. Click Save & Test.
Confirm that the username and password are correct.
Confirm that the SFTP service is running and listening on the configured port.
If your network restricts incoming connections, safelist the Fivetran IP addresses.
Test the connection with an external SFTP client using the same credentials.
In Fivetran, click Save & Test.
Keypair authentication
Ensure Login with keypair? is enabled:
i. In Fivetran, go to your SFTP connection page.
ii. Select the Settings tab.
iii. Click Edit connection.
iv. Set the Login with keypair? toggle to ON.
v. Click Save & Test.
From the connection settings page, make a note of the SFTP Server Public Key and add it to the
~/.ssh/authorized_keysfile for the correct user on the SFTP host.Make sure the public key appears on a single, unbroken line.
If you use a reverse SSH tunnel, add the SSH Tunnel Public Key to the tunnel host.
Set the required permissions:
Run chmod 700 ~/.sshRun chmod 600 ~/.ssh/authorized_keys
Confirm that the server's
sshd_configfile allowsPubkeyAuthenticationfor the applicable user.Check the SSH authentication logs for the reason the server rejected the key.
Confirm that the SFTP service is running and listening on the configured port.
If your network restricts incoming connections, safelist the Fivetran IP addresses.
In Fivetran, click Save & Test.
If the issue persists, contact our support team with the setup test results and relevant SSH authentication logs. Exclude passwords, private keys, and other sensitive information.
Cause
This issue occurs when Fivetran can't authenticate to the SFTP server. Common causes include:
- The authentication methods configured in Fivetran and on the SFTP server don't match.
- The username or password is incorrect.
- The Fivetran public key is missing or incorrectly configured.
- The
.sshdirectory orauthorized_keysfile has incorrect permissions. - The SFTP server doesn't allow public key authentication for the applicable user.
- A network restriction prevents Fivetran from reaching the server.