Documentation
¶
Overview ¶
Package sshkeyscan provides the ssh-keyscan utility — retrieve public host keys from remote SSH servers.
It exposes a Config struct with a Parse method for command-line argument parsing, a ScanHostKey function for scanning a single host/key-type pair, and a Run function that orchestrates the full scan.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseKeyTypes ¶
ParseKeyTypes translates user-friendly type names to SSH algorithm names.
Types ¶
type Config ¶
type Config struct {
AddressFamily string // "any", "inet", "inet6"
Hosts []string // positional host arguments
HostFile string // -f
Port int // -p
Timeout int // -T (seconds)
KeyTypes []string // -t
HashHosts bool // -H
Verbose bool // -v
Version bool // -V
// DialerConfig is populated during Parse and can be adjusted by callers
// before starting scans.
DialerConfig dialer.DialConfig
}
Config holds parsed ssh-keyscan command-line arguments.
func (*Config) GetDialerConfig ¶
func (cfg *Config) GetDialerConfig() dialer.DialConfig
GetDialerConfig returns the stored dialer configuration. Parse populates this field, and callers may adjust it before starting any scan.
func (*Config) Parse ¶
Parse populates cfg from command-line arguments. Fields set before calling Parse are preserved unless overridden. Default values: Port=22, Timeout=5.
func (*Config) RefreshDialerConfig ¶
func (cfg *Config) RefreshDialerConfig()
RefreshDialerConfig rebuilds DialerConfig from the parsed scanner args.