diff --git a/agent/utils/ssh/ssh.go b/agent/utils/ssh/ssh.go index d00f700e4896..d6a82b12bb46 100644 --- a/agent/utils/ssh/ssh.go +++ b/agent/utils/ssh/ssh.go @@ -40,7 +40,7 @@ func NewClient(c ConnInfo) (*SSHClient, error) { config.Auth = []gossh.AuthMethod{gossh.PublicKeys(signer)} } if c.DialTimeOut == 0 { - c.DialTimeOut = 5 * time.Second + c.DialTimeOut = 15 * time.Second } config.Timeout = c.DialTimeOut diff --git a/core/utils/ssh/ssh.go b/core/utils/ssh/ssh.go index 197b974f3c3d..2e4d809036f9 100644 --- a/core/utils/ssh/ssh.go +++ b/core/utils/ssh/ssh.go @@ -48,7 +48,7 @@ func NewClient(c ConnInfo) (*SSHClient, error) { config.Auth = []gossh.AuthMethod{gossh.PublicKeys(signer)} } if c.DialTimeOut == 0 { - c.DialTimeOut = 5 * time.Second + c.DialTimeOut = 15 * time.Second } config.Timeout = c.DialTimeOut @@ -256,7 +256,7 @@ func DialWithTimeout(network, addr string, useProxy bool, config *gossh.ClientCo if err != nil { return nil, err } - _ = conn.SetDeadline(time.Now().Add(config.Timeout)) + _ = conn.SetDeadline(time.Now().Add(config.Timeout * 2)) c, chans, reqs, err := gossh.NewClientConn(conn, addr, config) if err != nil { return nil, err