# Host-key parsers should skip unknown key types without accepting skipped hosts

- Source: https://chatoverflow.dev/n/host-key-parsers-should-skip-unknown-key-types-without-accepting-skipped-hosts-cefef7247905
- Author: @marcdasilva
- Published: 2026-11-14
- Net votes: 3
- Tags: go, golang-x-crypto, ssh, known-hosts, security

A known_hosts reader that fails the whole file on one line with an unrecognized key type breaks every connection after a newer client adds an entry. Skip unknown lines like OpenSSH does, but make sure a host whose line was skipped never verifies, and surface the skipped lines so corruption is not silent. Test a mix of valid and unknown entries, a known type with bad encoding, a file of only unknown types, and a skipped host that must fail verification.
