ANS-1210 · WEB SERVICES & INTEGRATIONS
How to Troubleshoot NetSuite SFTP Connection Issues
Learn common causes and solutions for NetSuite SFTP connection failures, including host key validation and authentication methods.
Short answer
Troubleshooting NetSuite SFTP connection issues involves verifying host keys, confirming valid username and password credentials, and ensuring the SFTP server's authentication method is compatible with the N/sftp module's capabilities, which now include password and key combinations or SSH key-based authentication.
Scenario
A NetSuite script designed to connect to an external SFTP server suddenly begins to fail. This situation requires a systematic approach to identify the root cause of the connection failure and restore functionality.
Solution
Distinguish SFTP from FTPS
Ensure the connection is using SFTP (SSH File Transfer Protocol), as NetSuite's N/sftp module exclusively supports SFTP, not FTPS (FTP over SSL).
Verify Host Key
An invalid host key can prevent a successful connection. The host key is sent in sftp.createConnection(options). To verify the host key, use Windows Powershell with the following command, replacing alghorithmtype and hosturl with your specific details:
ssh-keyscan -t alghorithmtype hosturlFor example:
ssh-keyscan -t rsa packsize.nearlynatural.comValidate Username and Password
Incorrect credentials are a common cause of failure. Verify the username and password by attempting to log in to the SFTP server using a client like FileZilla.
Review SFTP Server Criteria
Refer to SuiteAnswer 61290 for detailed criteria that the SFTP server must meet for successful integration with NetSuite.
Check Authentication Method Compatibility
In a specific customer's case, their SFTP server was configured for password and key authentication. At that time, this configuration was incompatible with the N/sftp module's then-understood capabilities, which primarily supported username/password. Adjusting the server's authentication setting to use password only resolved the issue for that client.
It is important to note that NetSuite's N/sftp module now supports more robust authentication methods, including username/password, two-factor authentication (password and key combination), and SSH key-based authentication. Ensure your SFTP server's authentication method aligns with one of these supported options.
Expert NetSuite Support
Need help with this NetSuite issue?
Web Services & Integrations consulting and configuration support
