When attempting to configure SFTP backups in NSX Manager, the username and password method works, but trying to configure SSH Private Key instead fails with an authentication error:
su
" to switch to the backup user and run command: "ls -l .ssh" to list the public key files, private key files, and the file named "authorized_keys". Check the permissions on those files look correct and ensure that the public key data has been copied from the <name>.pub file into the authorized_keys file. An example of a command that would copy the public key into authorized_keys is "cat .ssh/id_ed25519.pub >> .ssh/authorized_keys
"*This image shows the data of a keyfile that was generated in a support lab for example purposes. It has had a new line added at the end, after the final character in "-----END OPENSSH PRIVATE KEY-----"
If the above data were to be copied and pasted into the NSX UI without including the blank line at the end, authentication will fail with the error message described in this article.
VMware NSX
Private key data stored on the SFTP server doesn't exactly match what is being used when attempting to configure backups in the NSX Manager UI.
Ensure that the private key data saved on the SFTP server correctly matches the key data that is being pasted into the Private Key field in the Backup Configuration window in the NSX Manager UI. Any difference, including the presence of a newline character on the backup server that is excluded from what is entered in NSX Manager will cause the authentication to fail.
Suggestions for how to ensure that the private key from the SFTP server matches what is being submitted in NSX Manager:
Use a Plain Text Editor: Paste the key into a plain text editor like Notepad first to ensure no hidden characters are included.
Copy from Plain Text Editor: Copy the key from the plain text editor and paste it into the NSX UI Private Key field.
For other issues with NSX Backup and Restore operations, refer to Troubleshooting NSX Backup and Restore Failures
If you are contacting Broadcom support about this issue, please provide the following:
Handling Log Bundles for offline review with Broadcom support