summaryrefslogtreecommitdiff
path: root/internal/ssh/client/authmethods.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/ssh/client/authmethods.go')
-rw-r--r--internal/ssh/client/authmethods.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/internal/ssh/client/authmethods.go b/internal/ssh/client/authmethods.go
index ced1fb9..089a66a 100644
--- a/internal/ssh/client/authmethods.go
+++ b/internal/ssh/client/authmethods.go
@@ -35,8 +35,7 @@ func initKnownHostsAuthMethods(trustAllHosts bool, throttleCh chan struct{},
if err != nil {
dlog.Common.FatalPanic(knownHostsPath, err)
}
- dlog.Common.Debug("initKnownHostsAuthMethods", "Added known hosts file path",
- knownHostsPath)
+ dlog.Common.Debug("initKnownHostsAuthMethods", "Added known hosts file path", knownHostsPath)
if config.Common.ExperimentalFeaturesEnable {
sshAuthMethods = append(sshAuthMethods, gossh.Password("experimental feature test"))
dlog.Common.Debug("initKnownHostsAuthMethods", "Added experimental method to list of auth methods")
@@ -88,7 +87,11 @@ func initKnownHostsAuthMethods(trustAllHosts bool, throttleCh chan struct{},
}
dlog.Common.Debug("initKnownHostsAuthMethods", "Unable to use private key",
privateKeyPath, err)
- dlog.Common.FatalPanic("Unable to find private SSH key information")
+
+ // This is only a panic when we expect to do something about it.
+ if !config.Client.SSHDontAddHostsToKnownHostsFile {
+ dlog.Common.FatalPanic("Unable to find private SSH key information")
+ }
// Never reach this point.
return sshAuthMethods, knownHostsCallback