NetBackup IT Analytics - Data collection for NetBackup fails with error message: Auth fail at com.jcraft.jsch.Session.connect
Problem
NetBackup IT Analytics data collection for NetBackup is failing when the data collector policy is configured using private key.
Error Message
Error message in the NetBackup Job Details probe:
22 Mar 2023 13:56:45:802 WARN 1088219 main:JobDetailsProbe:nbuprimary.local
SshCommandExec.getCommandBufferedReader:425 - Error executing SSH command: "locale"
com.jcraft.jsch.JSchException: Auth fail at
com.jcraft.jsch.Session.connect(Session.java:518) at
com.aptare.dc.spi.protocolHandler.UnixRemoteHost.sshInit(UnixRemoteHost.java:611) at
com.aptare.dc.spi.protocolHandler.UnixRemoteHost.sshInit(UnixRemoteHost.java:413)
Cause
Test Connection in the NetBackup data collection policy is working successfully when the Private key is in RSA format.
Note: If creating Private key with ed25119, the Test connection is failing with Auth Fail Exception.
The issue is the current version of jsch jar is supporting RSA keys and the version 0.2.7 onwards have added support to edDSA type of putty keys.
Github reference : https://github.com/mwiede/jsch/releases/tag/jsch-0.2.7
Solution
Create Private key on NBU linux server using command ssh-keygen -t rsa and provide the passphrase
This will create two files id_rsa and id_rsa.pub
Append the id_rsa.pub key to the ~/.ssh/authorized_keys file.
Copy the id_rsa file to the Data Collector server.
Add the NetBackup policy and provide the key and passphrase information into the password field in the following format: privateKey=<path-of-private-key>|password=<passphrase>
Example:
privateKey=C:\Users\labuser\Desktop\id_rsa|password=adminRun On-demand data collection.