diff --git a/builder/amazon/common/ssh.go b/builder/amazon/common/ssh.go index 685914331..c451bbf96 100644 --- a/builder/amazon/common/ssh.go +++ b/builder/amazon/common/ssh.go @@ -88,6 +88,7 @@ func SSHConfig(useAgent bool, username, password string) func(multistep.StateBag Auth: []ssh.AuthMethod{ ssh.PublicKeysCallback(agent.NewClient(sshAgent).Signers), }, + HostKeyCallback: ssh.InsecureIgnoreHostKey(), }, nil } @@ -103,11 +104,13 @@ func SSHConfig(useAgent bool, username, password string) func(multistep.StateBag Auth: []ssh.AuthMethod{ ssh.PublicKeys(signer), }, + HostKeyCallback: ssh.InsecureIgnoreHostKey(), }, nil } else { return &ssh.ClientConfig{ - User: username, + User: username, + HostKeyCallback: ssh.InsecureIgnoreHostKey(), Auth: []ssh.AuthMethod{ ssh.Password(password), ssh.KeyboardInteractive( diff --git a/builder/azure/common/lin/ssh.go b/builder/azure/common/lin/ssh.go index f12ee09ea..7ee5a6064 100644 --- a/builder/azure/common/lin/ssh.go +++ b/builder/azure/common/lin/ssh.go @@ -5,6 +5,7 @@ package lin import ( "fmt" + "github.com/hashicorp/packer/builder/azure/common/constants" "github.com/mitchellh/multistep" "golang.org/x/crypto/ssh" @@ -32,6 +33,7 @@ func SSHConfig(username string) func(multistep.StateBag) (*ssh.ClientConfig, err Auth: []ssh.AuthMethod{ ssh.PublicKeys(signer), }, + HostKeyCallback: ssh.InsecureIgnoreHostKey(), }, nil } } diff --git a/builder/cloudstack/ssh.go b/builder/cloudstack/ssh.go index 192293bda..83243a407 100644 --- a/builder/cloudstack/ssh.go +++ b/builder/cloudstack/ssh.go @@ -36,6 +36,7 @@ func sshConfig(state multistep.StateBag) (*ssh.ClientConfig, error) { ssh.KeyboardInteractive( packerssh.PasswordKeyboardInteractive(config.Comm.SSHPassword)), }, + HostKeyCallback: ssh.InsecureIgnoreHostKey(), } if config.Comm.SSHPrivateKey != "" { diff --git a/builder/digitalocean/ssh.go b/builder/digitalocean/ssh.go index 5367dde1f..ebccb938a 100644 --- a/builder/digitalocean/ssh.go +++ b/builder/digitalocean/ssh.go @@ -2,6 +2,7 @@ package digitalocean import ( "fmt" + "golang.org/x/crypto/ssh" "github.com/mitchellh/multistep" @@ -26,5 +27,6 @@ func sshConfig(state multistep.StateBag) (*ssh.ClientConfig, error) { Auth: []ssh.AuthMethod{ ssh.PublicKeys(signer), }, + HostKeyCallback: ssh.InsecureIgnoreHostKey(), }, nil } diff --git a/builder/googlecompute/ssh.go b/builder/googlecompute/ssh.go index 5b7940591..5c224f0c6 100644 --- a/builder/googlecompute/ssh.go +++ b/builder/googlecompute/ssh.go @@ -27,5 +27,6 @@ func sshConfig(state multistep.StateBag) (*ssh.ClientConfig, error) { Auth: []ssh.AuthMethod{ ssh.PublicKeys(signer), }, + HostKeyCallback: ssh.InsecureIgnoreHostKey(), }, nil } diff --git a/builder/openstack/ssh.go b/builder/openstack/ssh.go index 3bf003e5e..9957c6163 100644 --- a/builder/openstack/ssh.go +++ b/builder/openstack/ssh.go @@ -84,6 +84,7 @@ func SSHConfig(useAgent bool, username, password string) func(multistep.StateBag Auth: []ssh.AuthMethod{ ssh.PublicKeysCallback(agent.NewClient(sshAgent).Signers), }, + HostKeyCallback: ssh.InsecureIgnoreHostKey(), }, nil } @@ -101,12 +102,14 @@ func SSHConfig(useAgent bool, username, password string) func(multistep.StateBag Auth: []ssh.AuthMethod{ ssh.PublicKeys(signer), }, + HostKeyCallback: ssh.InsecureIgnoreHostKey(), }, nil } else { return &ssh.ClientConfig{ - User: username, + User: username, + HostKeyCallback: ssh.InsecureIgnoreHostKey(), Auth: []ssh.AuthMethod{ ssh.Password(password), ssh.KeyboardInteractive( diff --git a/builder/parallels/common/ssh.go b/builder/parallels/common/ssh.go index c4c76fabf..8c2c8706f 100644 --- a/builder/parallels/common/ssh.go +++ b/builder/parallels/common/ssh.go @@ -44,8 +44,9 @@ func SSHConfigFunc(config SSHConfig) func(multistep.StateBag) (*ssh.ClientConfig } return &ssh.ClientConfig{ - User: config.Comm.SSHUsername, - Auth: auth, + User: config.Comm.SSHUsername, + Auth: auth, + HostKeyCallback: ssh.InsecureIgnoreHostKey(), }, nil } } diff --git a/builder/triton/ssh.go b/builder/triton/ssh.go index 9b5f20732..14fd26e31 100644 --- a/builder/triton/ssh.go +++ b/builder/triton/ssh.go @@ -3,14 +3,15 @@ package triton import ( "fmt" - packerssh "github.com/hashicorp/packer/communicator/ssh" - "github.com/mitchellh/multistep" - "golang.org/x/crypto/ssh" - "golang.org/x/crypto/ssh/agent" "io/ioutil" "log" "net" "os" + + packerssh "github.com/hashicorp/packer/communicator/ssh" + "github.com/mitchellh/multistep" + "golang.org/x/crypto/ssh" + "golang.org/x/crypto/ssh/agent" ) func commHost(state multistep.StateBag) (string, error) { @@ -49,6 +50,7 @@ func sshConfig(useAgent bool, username, privateKeyPath, password string) func(mu Auth: []ssh.AuthMethod{ ssh.PublicKeysCallback(agent.NewClient(sshAgent).Signers), }, + HostKeyCallback: ssh.InsecureIgnoreHostKey(), }, nil } @@ -72,12 +74,14 @@ func sshConfig(useAgent bool, username, privateKeyPath, password string) func(mu Auth: []ssh.AuthMethod{ ssh.PublicKeys(signer), }, + HostKeyCallback: ssh.InsecureIgnoreHostKey(), }, nil } else { log.Println("Configuring SSH keyboard interactive.") return &ssh.ClientConfig{ - User: username, + User: username, + HostKeyCallback: ssh.InsecureIgnoreHostKey(), Auth: []ssh.AuthMethod{ ssh.Password(password), ssh.KeyboardInteractive(