From a40bb9af99721414b420b2c19ea5e1c5a34a13f6 Mon Sep 17 00:00:00 2001 From: Kent Wang Date: Sun, 11 Jun 2017 15:58:45 +0800 Subject: [PATCH] Fix ssh config must specify HostKeyCallback Fixes: #5001 --- builder/alicloud/ecs/ssh_helper.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/builder/alicloud/ecs/ssh_helper.go b/builder/alicloud/ecs/ssh_helper.go index d3d6b8b1c..e08b3afff 100644 --- a/builder/alicloud/ecs/ssh_helper.go +++ b/builder/alicloud/ecs/ssh_helper.go @@ -49,6 +49,7 @@ func SSHConfig(useAgent bool, username, password string) func(multistep.StateBag Auth: []ssh.AuthMethod{ ssh.PublicKeysCallback(agent.NewClient(sshAgent).Signers), }, + HostKeyCallback: ssh.InsecureIgnoreHostKey(), }, nil } @@ -64,6 +65,7 @@ func SSHConfig(useAgent bool, username, password string) func(multistep.StateBag Auth: []ssh.AuthMethod{ ssh.PublicKeys(signer), }, + HostKeyCallback: ssh.InsecureIgnoreHostKey(), }, nil } else { @@ -73,7 +75,9 @@ func SSHConfig(useAgent bool, username, password string) func(multistep.StateBag ssh.Password(password), ssh.KeyboardInteractive( packerssh.PasswordKeyboardInteractive(password)), - }}, nil + }, + HostKeyCallback: ssh.InsecureIgnoreHostKey(), + }, nil } } }