Audit your known_hosts: who said yes, and what did they check?
Open your team's known_hosts file, or the one pasted into the wiki, and pick any line. Now try to answer three things about it. Who accepted that key? What did they compare it against? Was it compared against anything at
Open your team's known_hosts file, or the one pasted into the wiki, and pick any line. Now try to answer three things about it. Who accepted that key? What did they compare it against? Was it compared against anything at all?
On many teams nobody can answer. The entry is there, it works, and nobody recorded the moment it was created. That moment was a person at a terminal, probably in a hurry, typing yes.
What the prompt really asks
The first time a client meets a host, it has nothing to check the key against. It prints a fingerprint, says it cannot establish authenticity, and waits. Whatever you answer becomes the baseline. Every later connection that matches proves only that it matches the first one.
So the check holds on every connection except the one that counted. If something was sitting in the path that first time, the stored entry now vouches for it.
Nobody is reckless here. A device is down, a customer is on the phone, and the fingerprint on screen is a string with nothing to set it against. Typing yes is how the job gets done.
One answer, copied a hundred times
The entry rarely stays with the person who made it. A working line gets pasted into the wiki under "connecting to the relay". A colleague copies it. A laptop template ships with it. A provisioning script sets StrictHostKeyChecking=accept-new so nobody is asked again, which is the same yes, given once on behalf of every host to come.
A few months later a good share of the fleet's trust traces back to one tired answer. There is no ticket, no name and no fingerprint written down anywhere except the file that now defends itself.
The second yes is worse
When a key changes, the client refuses with a loud warning about a man-in-the-middle. The well-known fix is to delete the line and reconnect. Usually that is right: a unit was reimaged, a router was swapped, a relay was rebuilt. In a fleet of any size those happen so often that the warning becomes a chore.
That is the real cost. When nearly every change is routine, the rare genuine one looks routine too, and the person staring at it cannot tell them apart. A check dismissed by habit is only as strong as the habit.
Evidence the path cannot supply
If the connection runs through a relay, the fingerprint you are shown may come from whoever runs that relay, which is the party you most want to be able to distrust. For the check to mean anything, the evidence has to arrive another way. Three parts:
Read the fingerprint somewhere else. The device knows its own host key. If you can read the fingerprint off the device, for example from what the installer printed, you hold a value the path never touched. Compare all of it. Matching the first and last few characters is a habit worth dropping. A full comparison is tedious, and the tedium is the point.
Pin it. Once it has been checked against that independent source, store it and compare every later connection against the stored value.
Make accepting a change its own act. A changed key should stop the connection and stay stopped until someone with the authority to decide says it is legitimate. Deleting a line in your home directory is a private act. Accepting a change for the team should have an owner.
This is how we built RescueShell's shell access. The CLI and the browser shell check a device's host key against a fingerprint you paste from the device's first connection, and they refuse a later change. The relay records the first host key it sees for a device and refuses shells if it changes, until an admin accepts the new key. Key changes and accepts are recorded as fingerprints only, never key bodies. Refused sessions are recorded as well, and admins can see who opened a shell, on which device, and when.
The reason still lives with you
The record tells you that a key changed and when it was accepted. It cannot tell you why. That belongs in your own ticket or change log, and the habit we would push is one sentence there before you click accept: what changed, and how you know. If a device was reimaged on purpose, you already know the answer. If nobody can explain a change, find that out first.
The same applies to the first paste. Whoever pastes the fingerprint should be able to say where it came from.
Where this falls short
- Where the pasted fingerprint came from decides everything. If it was copied from a page the relay served, or from a message that travelled the same route, this is trust on first use with extra typing. We cannot see where your string came from.
- Accepting a change is still a human decision. We make it explicit and put it on record. We cannot make it correct. An admin who accepts under pressure without knowing why the key moved has repeated the old mistake somewhere more people can see it.
-
It takes more steps than typing
yes. For a handful of machines on a bench within reach, a plain jump host and aknown_hostsfile you verified once may be the sensible choice. The extra care pays back as the fleet and the team grow. - Some devices attest instead of paste. When many devices are enrolled in one pass, the pin can rest on an attestation rather than a pasted fingerprint. If the enrolment secret ever leaks, that is the weaker route.
- We see metadata. Who connected where, and when, is visible to our backend, and whoever operates the backend or relay can still refuse or drop sessions.
- No red-team result. Our goal is that full control of our backend and relay opens zero shells. No red-team exercise has tested that, so it is a goal and not a finding.
- The log is not a recording. It lists events. There is no session recording, no audit export, and no uptime SLA.
Two questions are still open on our side: how a team should hand the first fingerprint to a colleague without it passing back through the same path, and how often an unchanged pin should be re-checked. We have no rule that suits every fleet.
Try the audit
Pick ten lines from your known_hosts. For each, write down where the fingerprint came from. Wherever the answer is "the connection itself", you have found a standing decision nobody made on purpose.
The longer version of this argument is on our site: https://rescueshell.com/blog/the-first-yes-on-a-jump-host-is-a-standing-decision/
RescueShell is a remote shell service for fleets of devices, hosted in the EU (exceptions listed). Your first device is free to try with no card, and the 30-day trial starts when it connects. Until you add a card, shell traffic is capped at 50 MB in total and a second device needs a card. After that it is €0.10 per device a month, billed yearly, with a €6 yearly minimum, plus VAT.
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.