Merge pull request #5038 from hashicorp/5032

specify HostKeyCallback for vmware esx5 driver
This commit is contained in:
Matthew Hooker
2017-06-21 12:06:36 -07:00
committed by GitHub
3 changed files with 7 additions and 2 deletions
+2
View File
@@ -36,6 +36,7 @@ func sshConfig(comm *communicator.Config) func(state multistep.StateBag) (*gossh
Auth: []gossh.AuthMethod{
gossh.PublicKeys(signer),
},
HostKeyCallback: gossh.InsecureIgnoreHostKey(),
}, nil
} else {
// password based auth
@@ -46,6 +47,7 @@ func sshConfig(comm *communicator.Config) func(state multistep.StateBag) (*gossh
gossh.KeyboardInteractive(
ssh.PasswordKeyboardInteractive(comm.SSHPassword)),
},
HostKeyCallback: gossh.InsecureIgnoreHostKey(),
}, nil
}
}
+2
View File
@@ -39,6 +39,7 @@ func SSHConfig(useAgent bool, username string, password string, privateKeyFile s
Auth: []gossh.AuthMethod{
gossh.PublicKeysCallback(agent.NewClient(sshAgent).Signers),
},
HostKeyCallback: gossh.InsecureIgnoreHostKey(),
}, nil
}
@@ -61,6 +62,7 @@ func SSHConfig(useAgent bool, username string, password string, privateKeyFile s
Auth: []gossh.AuthMethod{
gossh.PublicKeys(signer),
},
HostKeyCallback: gossh.InsecureIgnoreHostKey(),
}, nil
} else {
// password based auth
+3 -2
View File
@@ -395,8 +395,9 @@ func (d *ESX5Driver) connect() error {
sshConfig := &ssh.Config{
Connection: ssh.ConnectFunc("tcp", address),
SSHConfig: &gossh.ClientConfig{
User: d.Username,
Auth: auth,
User: d.Username,
Auth: auth,
HostKeyCallback: gossh.InsecureIgnoreHostKey(),
},
}