Skip to content

matchKnownHostsEntry

function matchKnownHostsEntry(
entry: KnownHostsEntry,
host: string,
port?: number): boolean;

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

Returns true when the given host (and optional port) matches the entry’s host patterns. Hashed entries use HMAC-SHA1 verification per OpenSSH semantics.

ParameterTypeDefault valueDescription
entryKnownHostsEntryundefinedParsed known_hosts entry to test.
hoststringundefinedHostname or IP literal to match.
portnumberDEFAULT_SSH_PORTOptional connection port. Defaults to DEFAULT_SSH_PORT.

boolean

Whether the entry matches and is not negated.