Documentation
¶
Overview ¶
Package sshconfig reads the control plane's ~/.ssh/config so its hosts can become Lectern targets in one click (docs/ssh.md).
The host list comes from the file itself (Host lines, following Include). What each host resolves to comes from `ssh -G <alias>` when OpenSSH is installed, so Match blocks, wildcards and defaults resolve exactly as ssh would resolve them; without it, a small first-match-wins reader of the same file stands in.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Aliases ¶
Aliases lists every concrete Host name in the file: no wildcards, no negations, each once, in file order.
func DefaultPath ¶
func DefaultPath() string
DefaultPath is ~/.ssh/config for the user Lectern runs as.
Types ¶
type Host ¶
type Host struct {
Alias string `json:"alias"`
HostName string `json:"hostname"`
User string `json:"user"`
Port int `json:"port"`
IdentityFiles []string `json:"identity_files,omitempty"`
ProxyJump string `json:"proxy_jump,omitempty"`
ProxyCommand bool `json:"proxy_command,omitempty"`
ForwardAgent bool `json:"forward_agent,omitempty"`
GSSAPI bool `json:"gssapi,omitempty"`
IdentityAgent string `json:"identity_agent,omitempty"`
// SecurityKey is set when an identity file is a FIDO2 (sk-) key.
SecurityKey bool `json:"security_key,omitempty"`
// Resolver says how the values were found: "ssh -G" or "file".
Resolver string `json:"resolver"`
}
Host is one concrete alias and what it resolves to.