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,