From 34bb0429d0b75945807414585d8e20afb78ce820 Mon Sep 17 00:00:00 2001 From: r_takaishi Date: Wed, 11 Mar 2020 10:37:57 +0900 Subject: [PATCH] keyboard-interactive used when ssh_bastion_host is true. --- helper/communicator/config.go | 2 ++ helper/communicator/step_connect_ssh.go | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/helper/communicator/config.go b/helper/communicator/config.go index 83de5aea0..ae089a9af 100644 --- a/helper/communicator/config.go +++ b/helper/communicator/config.go @@ -132,6 +132,8 @@ type SSH struct { SSHBastionUsername string `mapstructure:"ssh_bastion_username"` // The password to use to authenticate with the bastion host. SSHBastionPassword string `mapstructure:"ssh_bastion_password"` + // If `true`, the keyboard-interactive used to authenticate with bastion host. + SSHBastionInteractive bool `mapstructure:"ssh_bastion_interactive"` // Path to a PEM encoded private key file to use to authenticate with the // bastion host. The `~` can be used in path and will be expanded to the // home directory of current user. diff --git a/helper/communicator/step_connect_ssh.go b/helper/communicator/step_connect_ssh.go index 63fc44699..8eb1c5156 100644 --- a/helper/communicator/step_connect_ssh.go +++ b/helper/communicator/step_connect_ssh.go @@ -246,7 +246,9 @@ func (s *StepConnectSSH) waitForSSH(state multistep.StateBag, ctx context.Contex func sshBastionConfig(config *Config) (*gossh.ClientConfig, error) { auth := make([]gossh.AuthMethod, 0, 2) - auth = append(auth, gossh.KeyboardInteractive(ssh.KeyboardInteractive())) + if config.SSHBastionInteractive { + auth = append(auth, gossh.KeyboardInteractive(ssh.KeyboardInteractive())) + } if config.SSHBastionPassword != "" { auth = append(auth,