fix: only check host keys on requested hosts

See .
This commit is contained in:
2021-11-09 17:43:24 +01:00
parent 17a5f1529a
commit 6f26b51f3e
5 changed files with 22 additions and 17 deletions
cli
pkg
config
ssh

@ -427,6 +427,11 @@ func connectWithPasswordTimeout(host, username, port, pass string, timeout time.
// EnsureHostKey ensures that a host key trusted and added to the ~/.ssh/known_hosts file
func EnsureHostKey(hostname string) error {
if hostname == "default" || hostname == "local" {
logrus.Debugf("not checking server SSH host key against local/default target")
return nil
}
exists, _, err := GetHostKey(hostname)
if err != nil {
return err