sureshanaparti commented on a change in pull request #5684:
URL: https://github.com/apache/cloudstack/pull/5684#discussion_r755946651



##########
File path: 
server/src/main/java/com/cloud/hypervisor/kvm/discoverer/LibvirtServerDiscoverer.java
##########
@@ -259,9 +259,17 @@ private void setupAgentSecurity(final Connection 
sshConnection, final String age
             sshConnection = new Connection(agentIp, 22);
 
             sshConnection.connect(null, 60000, 60000);
-            if (!sshConnection.authenticateWithPassword(username, password)) {
-                s_logger.debug("Failed to authenticate");
-                throw new DiscoveredWithErrorException("Authentication error");
+
+            final String privateKey = _configDao.getValue("ssh.privatekey");

Review comment:
       @weizhouapache I think, it is better to try with ssh key or password 
(based on the authentication mode), not with other when one of it fails. You 
can determine authentication mode, either from the user input or may be from 
password/privatekey config.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to