// If the server supports public key lets look for an agent and try
// some of his keys
if (supported.contains("publickey")) {
if (System.getProperty("sshtools.agent") != null) {
try {
SshAgentClient agent = SshAgentClient.connectLocalAgent("SSHTerm",
System.getProperty("sshtools.agent") /*, 5*/);
AgentAuthenticationClient aac = new AgentAuthenticationClient();
aac.setAgent(agent);
aac.setUsername(getCurrentConnectionProfile().getUsername());
result = ssh.authenticate(aac);
agent.close();
} catch (AgentNotAvailableException ex) {
log.info("No agent was available for authentication");
// Just continue
}