keyboard-interactive used when ssh_bastion_host is true.
This commit is contained in:
parent
a0dfcf3715
commit
34bb0429d0
|
@ -132,6 +132,8 @@ type SSH struct {
|
||||||
SSHBastionUsername string `mapstructure:"ssh_bastion_username"`
|
SSHBastionUsername string `mapstructure:"ssh_bastion_username"`
|
||||||
// The password to use to authenticate with the bastion host.
|
// The password to use to authenticate with the bastion host.
|
||||||
SSHBastionPassword string `mapstructure:"ssh_bastion_password"`
|
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
|
// 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
|
// bastion host. The `~` can be used in path and will be expanded to the
|
||||||
// home directory of current user.
|
// home directory of current user.
|
||||||
|
|
|
@ -246,7 +246,9 @@ func (s *StepConnectSSH) waitForSSH(state multistep.StateBag, ctx context.Contex
|
||||||
func sshBastionConfig(config *Config) (*gossh.ClientConfig, error) {
|
func sshBastionConfig(config *Config) (*gossh.ClientConfig, error) {
|
||||||
auth := make([]gossh.AuthMethod, 0, 2)
|
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 != "" {
|
if config.SSHBastionPassword != "" {
|
||||||
auth = append(auth,
|
auth = append(auth,
|
||||||
|
|
Loading…
Reference in New Issue