summaryrefslogtreecommitdiff
path: root/internal/ssh/client/authmethods.go
diff options
context:
space:
mode:
authorPaul Buetow <35781042+pbuetow@users.noreply.github.com>2021-03-29 17:49:16 +0100
committerGitHub <noreply@github.com>2021-03-29 17:49:16 +0100
commit9a467da883976c74d231ea9c7773430f583bab98 (patch)
tree4e75a996ef44bc5adc771c318753b0c4ad934269 /internal/ssh/client/authmethods.go
parente811d1725ee5f931ece6fac01db70227b0fc8a7a (diff)
parent93fce245564ffde20c3e5113757bc65672f69ed5 (diff)
Merge pull request #22 from snonux/develop
Add context awareness to dgrep
Diffstat (limited to 'internal/ssh/client/authmethods.go')
-rw-r--r--internal/ssh/client/authmethods.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/internal/ssh/client/authmethods.go b/internal/ssh/client/authmethods.go
index 2ff80b2..bbfb7be 100644
--- a/internal/ssh/client/authmethods.go
+++ b/internal/ssh/client/authmethods.go
@@ -77,6 +77,15 @@ func initKnownHostsAuthMethods(trustAllHosts bool, throttleCh chan struct{}, pri
}
logger.Debug("initKnownHostsAuthMethods", "Unable to use private key", privateKeyPath, err)
+ privateKeyPath = os.Getenv("HOME") + "/.ssh/id_ecdsa"
+ authMethod, err = ssh.PrivateKey(privateKeyPath)
+ if err == nil {
+ sshAuthMethods = append(sshAuthMethods, authMethod)
+ logger.Debug("initKnownHostsAuthmethods", "Added path to list of auth methods, not adding further methods", privateKeyPath)
+ return sshAuthMethods, knownHostsCallback
+ }
+ logger.Debug("initKnownHostsAuthMethods", "Unable to use private key", privateKeyPath, err)
+
logger.FatalExit("Unable to find private SSH key information")
// Never reach this point.