Skip to main content

Module ssh_config

Module ssh_config 

Source
Expand description

Lightweight ~/.ssh/config parser + merge with prt’s own host config.

Only the directives needed to identify a destination are recognised: Host, HostName, User, Port, IdentityFile. Everything else is silently ignored. Wildcard host blocks (Host * / Host foo?bar) are skipped — they match patterns rather than name a concrete target.

Structs§

SshHost
One concrete SSH destination (no wildcards).

Enums§

SshHostSource
Where a host definition came from.

Functions§

default_ssh_config_path
Default ~/.ssh/config path.
from_prt_config
Convert a prt-config host entry to an SshHost.
load_known_hosts
Load known hosts: parse ~/.ssh/config and merge with prt-config hosts. Aliases from prt-config win on collision.
parse_ssh_config
Parse ~/.ssh/config (or any file with that grammar). Resolves Include directives relative to the SSH config root (the parent directory of the top-level file, e.g. ~/.ssh/), matching OpenSSH semantics. Recursion is capped at [MAX_INCLUDE_DEPTH] so circular includes don’t loop. On failure, returns an empty list — this is best-effort enrichment.