SSH Banners and Host Keys: What Your Server Tells Strangers

An SSH banner is the version line an SSH server sends to anyone who connects — and together with the algorithm lists in its first packet and the host key it presents during key exchange, it is a complete public description of the server's cryptography, available to complete strangers before any login. None of it is secret, and none of it requires credentials: it is how SSH is designed to open a connection. But it is also a faithful record of neglect — servers still offering SHA-1 key exchange, CBC ciphers and ssh-rsa in 2026 are telling the internet their configuration has not been reviewed in years. This article explains what the banner and KEXINIT actually contain, why a host key fingerprint only protects you when you verify it out of band, how to clean up the deprecated algorithms, and how to read your own server the way a scanner does, with the SSH Banner & Host Key Checker.

What your server tells complete strangers, in one pass

Connect to any SSH server and, before you have typed a username, you hold three artefacts. The banner: a single line naming the protocol and, usually, the software and its version. The KEXINIT lists: eight name-lists covering every key-exchange method, host key algorithm, cipher, MAC and compression scheme the server will accept, in each direction. And the host key: the server's identity key, presented as soon as a key exchange completes, whose fingerprint is the value SSH asks you to confirm on first connection. All three are public by design — a client cannot negotiate a session without them.

Public is not the same as harmless. The banner and the lists are a fingerprint of the server's age and care: they tell a scanner which software family it is looking at, which known-weak algorithms the server still accepts, and — from the host key type — roughly which era the server was provisioned in. Attackers do not start by attacking; they start by inventorying, and this is the inventory. The good news is that everything on the list is under the server administrator's control: nothing a stranger can read here is anything the server did not choose to offer.

The banner and KEXINIT, explained

The banner is defined by RFC 4253: the server sends SSH-protoversion-softwareversion followed by optional comments, in a line of at most 255 characters, before anything else happens. OpenSSH servers typically send something like SSH-2.0-OpenSSH_9.6p1, naming the implementation and its exact version; the protocol field can also be 1.99, which advertises compatibility with the obsolete SSH1 protocol alongside SSH2. Some operators replace the software field entirely — github.com answers SSH-2.0-9f8779a8, an opaque token that names no software at all. A banner is a claim the server makes about itself: it costs nothing to print a false one, and hardened servers sometimes do.

KEXINIT is the first binary packet of the transport protocol, and despite starting the encrypted session it is itself entirely readable: a cookie followed by ten name-lists, of which the eight that matter publicly are the key-exchange algorithms, the server host key algorithms, and the encryption, MAC and compression algorithms for each direction. Negotiation is simple — for each category, the first algorithm on the client's list that also appears on the server's list wins — which is why the lists are offers, not results: what a session actually uses depends on who connects. But the offers are the server's policy, written down. A server that still offers diffie-hellman-group1-sha1 will use it with a client that asks, and that is exactly the property worth auditing. The SSH Banner and Host Key Checker showing the github.com demo: banner SSH-2.0, the offered algorithm lists and the ssh-ed25519 host key fingerprint

Host key fingerprints: verify them out of band, or not at all

The host key is how SSH answers the question "am I talking to the right machine?" The server proves possession of the private key during the exchange; the client checks the public key against its known_hosts file, and on first contact asks the human to confirm a fingerprint — SHA256 of the key blob, printed by ssh-keygen -lf and by every first-connection prompt. For github.com that fingerprint is +DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU for the Ed25519 key, and GitHub publishes it in its documentation precisely so users can compare a value obtained from the connection with a value obtained somewhere else.

That comparison is the whole mechanism. A fingerprint read from the same connection you are trying to verify proves nothing — an interceptor presenting a different key would present its fingerprint just as confidently. Out of band means a different channel: the provider's documentation or console, the server's own ssh-keygen output read over an existing trusted session, a configuration management record. When a fingerprint changes unexpectedly, treat it as a stop sign, not a nuisance prompt: rebuilt servers and new load balancers explain most changes, but "most" is doing real work in that sentence, and the check costs a minute.

Retiring SHA-1, CBC and friends — without locking anyone out

The deprecated list is stable and short. Key exchange: diffie-hellman-group1-sha1 (a 1024-bit group), group14-sha1 and group-exchange-sha1 — SHA-1 and small groups. Host keys: ssh-rsa, which signs with SHA-1, and ssh-dss, capped at 1024 bits. Ciphers: arcfour (RC4), the CBC family, and the 64-bit-block ciphers blowfish, CAST and 3DES. MACs: hmac-md5 and hmac-sha1. Compression: plain zlib before authentication. The Mozilla OpenSSH guidelines publish a modern list to converge on — curve25519-sha256, Ed25519 and RSA-SHA2 host keys, chacha20-poly1305 and AES-GCM ciphers, SHA-2 encrypt-then-MAC — and current OpenSSH defaults are already close to it; a server still offering the old set is usually running an old daemon or a configuration copied forward for a decade.

The compatibility fear is mostly outdated. ssh-rsa is the subtle one: it is a signature algorithm, not a key type, so removing it does not retire your RSA host keys — the same keys keep working as rsa-sha2-512 and rsa-sha2-256, and OpenSSH clients have supported those since 7.2 (2016). CBC removal strands only pre-2014 clients in practice. The safe procedure is boring: set KexAlgorithms, HostKeyAlgorithms, Ciphers and MACs explicitly in sshd_config, reload rather than restart, test a fresh connection from your oldest real client, and then re-read the server from outside — the offer list a stranger sees is the ground truth of whether the change took.

Banner version disclosure: a minor leak, not a vulnerability

Security scanners dutifully report "SSH version disclosed" as a finding, and it deserves its low severity. Knowing a server runs OpenSSH 8.9 saves an attacker the trouble of trying exploits for other versions — it prioritises, it does not enable. Every serious attack path works by trying the exploit anyway, and version-based targeting mostly matters for worms and mass scanners, which try everything regardless. Treating version disclosure as a vulnerability to be remediated ahead of patching inverts the actual risk: an unpatched server with a scrubbed banner is still unpatched, and now its operator has one less reminder of what is running.

There are still reasons to trim the banner. It costs nothing to keep internal build details, OS package suffixes and host roles out of the comments field, and large fleets often standardise the banner so inventory tools see one shape. Some operators replace the software token entirely, as GitHub does, accepting that monitoring must then identify servers another way. What does not work is relying on the banner for defence in either direction: attackers do not trust it when fingerprinting (behavioural probes identify OpenSSH regardless of the string), and defenders should not trust it when inventorying — read the daemon's actual version from the host. In the checker's scoring, disclosure is information only; an end-of-life version costs points for being end-of-life, not for being visible.

Reading your own server like a scanner

The five-minute pass is the one this article is built around. First, read your server from outside with the SSH Banner & Host Key Checker: the banner, all eight algorithm lists, the host key type and its fingerprints, scored against the deprecation lists. Note anything in the deprecated classes, any missing piece of the modern set, and whether the served host key is the type and size you expect. Second, compare the fingerprint with the one from the server itself — ssh-keygen -lf on the public key file — because the outside view and the inside view agreeing is the cheapest integrity check there is.

Then fix the configuration, not the symptom. The static sibling of this check is the SSH Server Config Auditor, which audits sshd_config itself in your browser: run the file you are about to deploy through it before the reload, and use the Port Scanner to confirm SSH is the only service exposed that should not be. After the reload, re-read the server from outside once more. Configuration drifts, images get rebuilt from old templates, and a port that answered last quarter may not be the server you think it is — the outside read is the only one that counts, because it is the one everyone else gets too.

The demo target, from the wire and from the shell

# What github.com's SSH server says first (the RFC 4253 banner):
SSH-2.0-9f8779a8

# The same host key fingerprint the checker retrieves, from the shell:
$ ssh-keyscan -t ed25519 github.com 2>/dev/null | ssh-keygen -lf -
256 SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU github.com (ED25519)

Sources

Frequently asked questions

Can a server hide its banner and algorithm lists entirely?

The banner can be replaced with an opaque string, as github.com does, but it cannot be omitted — the version exchange is how an SSH connection starts, and a client that receives no banner cannot proceed. The KEXINIT lists likewise cannot be hidden: they are the negotiation itself. What a server can do is shorten the lists to the modern set, which is the real fix — a short, current offer list tells a scanner almost nothing worth knowing beyond "this server is maintained".

ssh-rsa is deprecated — do I need new host keys?

Usually not. ssh-rsa names a signature algorithm (RSA with SHA-1), not a key: the same RSA host key signs perfectly well with SHA-2 as rsa-sha2-512 or rsa-sha2-256, which is why OpenSSH 8.8 could disable ssh-rsa by default without breaking servers that kept their RSA keys. What you change is the HostKeyAlgorithms list in sshd_config, not the keys. The exceptions are DSA keys (ssh-dss) — those really do need replacing, with Ed25519 — and RSA keys under 2048 bits.

How often should I re-check a server's public offer?

Whenever the server, its image or its SSH package changes — and on a schedule anyway, because drift is the whole problem. A quarterly outside read takes a minute and catches the classic regressions: a rebuilt instance that came back with distribution defaults from an old template, a compatibility line added for one legacy client and never removed, a second SSH daemon on an alternate port nobody remembered. Pair it with checking the fingerprint against your records: configuration and identity are the two things the outside read gives you, and both rot silently.