From 7a6c1a7d1419c7b3f06f3412d6f765eb749d2f0b Mon Sep 17 00:00:00 2001 From: Dave Henderson Date: Wed, 15 Apr 2015 11:23:08 -0400 Subject: [PATCH] Reducing the number of connection attempts, and setting an explicit timeout of 10 seconds Signed-off-by: Dave Henderson --- ssh/ssh.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ssh/ssh.go b/ssh/ssh.go index bc89412732..9fccc73e54 100644 --- a/ssh/ssh.go +++ b/ssh/ssh.go @@ -15,7 +15,8 @@ func GetSSHCommand(host string, port int, user string, sshKey string, args ...st "-o", "IdentitiesOnly=yes", "-o", "StrictHostKeyChecking=no", // don't bother checking in ~/.ssh/known_hosts "-o", "UserKnownHostsFile=/dev/null", // don't write anything to ~/.ssh/known_hosts - "-o", "ConnectionAttempts=30", // retry 30 times if SSH connection fails + "-o", "ConnectionAttempts=3", // retry 3 times if SSH connection fails + "-o", "ConnectTimeout=10", // timeout after 10 seconds "-o", "LogLevel=quiet", // suppress "Warning: Permanently added '[localhost]:2022' (ECDSA) to the list of known hosts." "-p", fmt.Sprintf("%d", port), "-i", sshKey,