Skip to content

Commit

Permalink
Allow a much longer time for ssh timeouts, but keep timeout the same …
Browse files Browse the repository at this point in the history
…for auth
  • Loading branch information
bbpennel committed Dec 6, 2024
1 parent ca98dfe commit c09dbf8
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
*/
public class SshClientService {
private static final Logger log = getLogger(SshClientService.class);
private static final int SSH_TIMEOUT_SECONDS = 10;
private static final int SSH_TIMEOUT_SECONDS = 60 * 5;
private static final int AUTH_TIMEOUT_SECONDS = 10;

private String sshHost;
private int sshPort;
Expand Down Expand Up @@ -125,7 +126,7 @@ public void executeSshBlock(Consumer<ClientSession> sshBlock) {
.verify(SSH_TIMEOUT_SECONDS, TimeUnit.SECONDS)
.getSession()) {
setupSessionAuthentication(sshSession);
sshSession.auth().verify(SSH_TIMEOUT_SECONDS, TimeUnit.SECONDS);
sshSession.auth().verify(AUTH_TIMEOUT_SECONDS, TimeUnit.SECONDS);
sshBlock.accept(sshSession);
} catch (IOException e) {
if (e instanceof SshException && e.getMessage().contains("No more authentication methods available")) {
Expand Down

0 comments on commit c09dbf8

Please sign in to comment.