Documentation
¶
Index ¶
- Variables
- func ExpandHome(inputPath string) string
- func MultipleDefault(key string) []string
- type Host
- func (h *Host) Addr() string
- func (h *Host) Agent() (agent.ExtendedAgent, error)
- func (h *Host) AgentSockName() string
- func (h *Host) ConfigGet(key string) string
- func (h *Host) ConfigGetAll(key string) []string
- func (h *Host) Configure(cfg sshSettingsGetter) error
- func (h *Host) Dial(network string) (*ssh.Client, error)
- func (h *Host) ExpandTokens(in string) string
- func (h *Host) GetClientConfig() (*ssh.ClientConfig, error)
- func (h *Host) GetSigners() ([]ssh.Signer, error)
- func (h *Host) GetSignersCallback() (func() ([]ssh.Signer, error), error)
- func (h *Host) IdentitiesOnly() bool
- func (h *Host) IdentityPublicKeys() []ssh.PublicKey
- func (h *Host) KnownHosts() []string
- func (h *Host) NewClient(conn net.Conn) (*ssh.Client, error)
- func (h *Host) ProxyJump() []string
- func (h *Host) ProxyJumpHosts() ([]*Host, error)
- type Settings
- type UserSettings
Constants ¶
This section is empty.
Variables ¶
var DefaultUserSettings = &UserSettings{ssh_config.DefaultUserSettings}
var ErrAgentDisabled = errors.New("SSH Agent Disabled")
Functions ¶
func ExpandHome ¶
func MultipleDefault ¶
MultipleDefault returns the default values for the given keyword, for example// {"22"} if the keyword is "Port". MultipleDefault returns nil if the keyword has no default, or if the keyword is unknown. Keyword matching is case-insensitive.
MultipleDefault return more than one element for "IdentityFile" keyword.
Types ¶
type Host ¶
type Host struct { Name string Hostname string Port string User string *ssh.ClientConfig // contains filtered or unexported fields }
func ParseSshURI ¶
ParseSshURI parse either [user@]host[:port] or an ssh URI ie ssh://[user@]host[:port].
func (*Host) AgentSockName ¶
func (*Host) ConfigGetAll ¶
func (*Host) ExpandTokens ¶
ExpandTokens expand % tokens
%% A literal ‘%’. %h The remote hostname. %n The original remote hostname, as given on the command line. %p The remote port. %r The remote username.
TODO: complete the list of tokens and allow selecting them depending on the key see: https://github.com/openssh/openssh-portable/blob/master/sshconnect.h#L54 %c see https://github.com/openssh/openssh-portable/blob/master/readconf.c#L354
func (*Host) GetClientConfig ¶
func (h *Host) GetClientConfig() (*ssh.ClientConfig, error)
TODO: add options to customize config TODO: make thread safe ?
func (*Host) GetSignersCallback ¶
func (*Host) IdentitiesOnly ¶
func (*Host) IdentityPublicKeys ¶
func (*Host) KnownHosts ¶
func (*Host) ProxyJumpHosts ¶
type Settings ¶
type Settings struct {
// contains filtered or unexported fields
}
func OpenSSHConfig ¶
func (*Settings) GetAllStrict ¶
type UserSettings ¶
type UserSettings struct {
*ssh_config.UserSettings
}
UserSettings overrides ssh_config.UserSettings to handle MultipleDefault
func (*UserSettings) GetAll ¶
func (u *UserSettings) GetAll(alias, key string) []string
func (*UserSettings) GetAllStrict ¶
func (u *UserSettings) GetAllStrict(alias, key string) ([]string, error)