From 8f47078988da92b57df6e8abe9c27a2ca6b74f43 Mon Sep 17 00:00:00 2001 From: galal-hussein Date: Tue, 28 Aug 2018 21:44:06 +0200 Subject: [PATCH] Skip check for private key if using ssh agent --- hosts/dialer.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hosts/dialer.go b/hosts/dialer.go index 2ace1b8a..1c07f97d 100644 --- a/hosts/dialer.go +++ b/hosts/dialer.go @@ -40,7 +40,7 @@ func newDialer(h *Host, kind string) (*dialer, error) { netConn: "tcp", useSSHAgentAuth: h.SSHAgentAuth, } - if bastionDialer.sshKeyString == "" { + if bastionDialer.sshKeyString == "" && !bastionDialer.useSSHAgentAuth { var err error bastionDialer.sshKeyString, err = privateKeyPath(h.BastionHost.SSHKeyPath) if err != nil { @@ -59,7 +59,7 @@ func newDialer(h *Host, kind string) (*dialer, error) { bastionDialer: bastionDialer, } - if dialer.sshKeyString == "" { + if dialer.sshKeyString == "" && !dialer.useSSHAgentAuth { var err error dialer.sshKeyString, err = privateKeyPath(h.SSHKeyPath) if err != nil {