rescueshell Start trial

known_hosts and authorized_keys line checker

Paste one or a few lines from a known_hosts or authorized_keys file. The page says what each line is: a host key line, a hashed one, a @cert-authority or @revoked line, an authorized_keys line with or without options, a comment or a blank. For a line that is cut off or broken, it names the field that is wrong.

Nothing you type leaves this page: the checker makes no request, sets no cookie and stores nothing. It reads the shape of a line only. It does not contact a host, does not check that a key belongs to a server or a person, and does not check option values. The site's usual cookie-free page count still loads, as on every page, and it never includes what you type.

The line forms it reads

A known_hosts line is, in order, an optional marker, the host names, the key type, the key data and an optional comment, separated by spaces. The host names are one field: several are joined by commas with no spaces, * and ? are wildcards, a leading ! excludes a name, and [host]:port names a non-standard port. A name can instead be hashed, which looks like |1| followed by a salt and a hash. A hashed name is the only name on its line, with no wildcards or !. The two markers are @cert-authority, which says the key signs host certificates, and @revoked, which says the key must not be accepted. Lines that start with # and empty lines are comments.

An authorized_keys line is an optional options field, the key type, the key data and an optional comment. The options are one field of comma-separated entries, and a value with spaces in it goes in double quotes. This page lists the option names it sees and does not judge them or their values: sshd decides what an option means.

What it will not tell you

A line that reads cleanly is only well formed. It says nothing about whether the key is the right one, whether a host really has it, or whether the server will accept the line. A key type the page does not know is named as typed, with no claim about it. To compare a key with a fingerprint you were given, use the fingerprint checker.

Where this fits

This page reads a line you already have. If ssh could not write a new line at all, that is a different problem, covered in failed to add the host to known_hosts. For a host key warning, see a changed host key, and for the first-connection prompt, whether to trust a host for the first time. If ssh refuses a file because of who owns it, see bad owner or permissions. To see what ssh itself said, paste the output into the ssh -v reader. More free tools are on the tools page.

Or skip the key files

RescueShell is a hosted relay: the device dials out over HTTPS, nothing comes in, and you open the shell from a browser. 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.