Skip to content

matchKnownHosts

function matchKnownHosts(
entries: readonly KnownHostsEntry[],
host: string,
port?: number): KnownHostsEntry[];

Defined in: src/profiles/importers/KnownHostsParser.ts:133

Filters parsed entries down to those that match the given host/port. Negations are honored.

ParameterTypeDefault valueDescription
entriesreadonly KnownHostsEntry[]undefinedEntries returned by parseKnownHosts.
hoststringundefinedHostname or IP literal to match.
portnumberDEFAULT_SSH_PORTOptional connection port. Defaults to DEFAULT_SSH_PORT.

KnownHostsEntry[]

Matching entries in source order.