Documentation ¶
Overview ¶
Package sshhelper is a toolkit for common ssh-related operations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddKeyToAgent ¶
AddKeyToAgent adds a key to the internal ssh-key agent. If a public key can be found at the same path as the private key, it will first check the agent and return nil if the key is already present
func GetPasswordInput ¶
GetPasswordInput retrieves input that doesn't echo back to the user as they type it
func GetSSHAgent ¶
GetSSHAgent creates a new ssh-agent, originally it would return one only if it was needed, but it's probably better to always use our own.
func LoadDefaultKey ¶
LoadDefaultKey loads the default for an alias/host and puts it into the keyring if a default key is not found, the user is prompted to provide the path
Types ¶
type ExistingSSHAgentCallback ¶
type ExistingSSHAgentCallback struct { User string Callback func() (signers []ssh.Signer, err error) gogitssh.HostKeyCallbackHelper }
ExistingSSHAgentCallback is based on gogit's transport ssh public key callback, but allows for using an existing ssh-agent
func NewExistingSSHAgentCallback ¶
func NewExistingSSHAgentCallback(a agent.Agent) *ExistingSSHAgentCallback
func (*ExistingSSHAgentCallback) ClientConfig ¶
func (a *ExistingSSHAgentCallback) ClientConfig() (*ssh.ClientConfig, error)
func (*ExistingSSHAgentCallback) Name ¶
func (a *ExistingSSHAgentCallback) Name() string
func (*ExistingSSHAgentCallback) String ¶
func (a *ExistingSSHAgentCallback) String() string