keyboard-interactive used when ssh_bastion_host is true.

This commit is contained in:
r_takaishi 2020-03-11 10:37:57 +09:00
parent a0dfcf3715
commit 34bb0429d0
2 changed files with 5 additions and 1 deletions

View File

@ -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.

View File

@ -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)
if config.SSHBastionInteractive {
auth = append(auth, gossh.KeyboardInteractive(ssh.KeyboardInteractive()))
}
if config.SSHBastionPassword != "" {
auth = append(auth,