rescueshell Start trial

SSH "authenticity of host can't be established"

The first time OpenSSH reaches a host it has no stored key for, it shows the key's fingerprint and asks whether to continue. This is a question, not an error. It exists so that you can check you are talking to the machine you meant, and it is worth thirty seconds before you type yes.

This page describes standard OpenSSH behaviour. The commands are the usual ones from the OpenSSH tools, and wording can differ a little between versions.

What the prompt says

The authenticity of host 'server.example.com (192.0.2.10)' can't be established.
ED25519 key fingerprint is SHA256:...
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])?

ssh has already reached something at that address, and it is showing you the key that thing offered. It has nothing recorded to compare against, so it cannot tell you whether the key is the right one. Nothing has been sent to the host yet: no password and no key signature.

This is not the REMOTE HOST IDENTIFICATION HAS CHANGED warning, which means a key is stored and the host now offers a different one. It is also not a timeout, a refusal or Permission denied: the connection worked, and login has not started.

Why you are being asked now

ssh asks when no entry in its known hosts files matches what you typed:

In each case the prompt is expected. If you were sure you had connected to this exact name and port before and the prompt appears anyway, look at which file ssh is reading before you assume anything about the host.

Check the fingerprint against a second source

The fingerprint on your screen arrived through the connection you are trying to verify. Comparing it with itself proves nothing. You need a copy that came another way. Good sources:

Compare the full SHA256: text, not the first few characters. If you would rather not compare by eye, paste both into the SSH key fingerprint checker. It runs in your browser, sends nothing, and says whether the two match. Once the host is saved, the line checker can read the line ssh wrote and say what kind it is; it does not say whether the key is the right one.

Do not use ssh-keyscan as the second source. It fetches the key over the same network path as your connection, so if something is in the way, both outputs come from it and they will agree.

Then decide

Newer OpenSSH versions also accept the fingerprint itself, typed or pasted, as the answer, which is a convenient way to confirm you are accepting the key you checked. Older ones accept only yes and no.

Answering no, or running without a terminal where ssh cannot ask, ends with Host key verification failed. In that case it just means the key was not accepted, not that a stored key changed. To see what a longer log shows, paste it into the ssh -v output reader.

What not to do

Do not set StrictHostKeyChecking no to make the prompt go away, and do not delete known_hosts. The first turns the check off for every host it applies to, and the second throws away the recorded keys that protect the hosts you have already verified. If the message you see is the changed-key one, read that guide and remove only the one stale entry.

If the machine is a RescueShell device

RescueShell does not use this prompt for the device. The first time a browser connects to a device, the page asks you to check the device's fingerprint once. See the first-connection step in the troubleshooting page. A check made through the device does not replace checking a public SSH host that you still connect to directly. Those hosts keep their own prompt, and the steps above still apply to them.

Try it on one device

The first device is free to try with no card, for 30 days from when it connects, not from when you sign up. Start a trial.