Skip to content

Support OTP for SSH communicator #296

@sparshev

Description

@sparshev

Description

Probably it will be useful to be able to pass a function to communicator that will trigger requesting of a new credentials and then form a required sshconfig or just credentials side of it, so while communicator establishes connection it would call this function and receive the new credentials.

Or maybe there is another way - but I found no good interfaces to implement such strategy.

Use Case(s)

Our compute resource management system requires user to create new access request every time it's connecting via SSH to the allocated instance. While preparing builder plugin for it I found there is no easy way to regenerate sshconfig for new connection.

Potential configuration

&communicator.StepConnectSSH{
        Config:    &b.config.Communicator,
        Host:      commFunc(host),
        SSHConfigOtp: sshConfigFunc,
}

Potential References

As far I dug in - here is the place where sshconfig is used statically: https://github.com/hashicorp/packer-plugin-sdk/blob/main/sdk-internals/communicator/ssh/communicator.go#L346

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions