Bug 2560 - sshd: Description of hashed known_hosts file does not make sense and format is outdated
Summary: sshd: Description of hashed known_hosts file does not make sense and format i...
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: Documentation (show other bugs)
Version: -current
Hardware: Other Linux
: P5 enhancement
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-01 18:51 AEDT by Jakub Jelen
Modified: 2021-04-23 15:00 AEST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jakub Jelen 2016-04-01 18:51:33 AEDT
Manual page for  sshd  states:

    Alternately, hostnames may be stored in a hashed form which hides
    host names and addresses should the file's contents be disclosed.

The ending part "should the file's contents be disclosed" does not fit into the sentence and I am not sure what is meant by that.

It is there for a long time, since e1776155d19db4f3ab2ff42323d6499f0712cfa4


Also the format, described as:

    Each line in these files contains the following fields: markers (optional),
    hostnames, bits, exponent, modulus, comment.

is outdated (describes RSA1 keys). In current situation the part "bits, exponent, modulus" is substituted by "keytype, base64-encoded key" as described for example in  authorized_keys  section.


I hit this problem while referencing to the format of this file.
Comment 1 Damien Miller 2016-04-08 14:31:53 AEST
It's saying that (In reply to Jakub Jelen from comment #0)
> Manual page for  sshd  states:
> 
>     Alternately, hostnames may be stored in a hashed form which hides
>     host names and addresses should the file's contents be disclosed.
> 
> The ending part "should the file's contents be disclosed" does not
> fit into the sentence and I am not sure what is meant by that.
> 
> It is there for a long time, since
> e1776155d19db4f3ab2ff42323d6499f0712cfa4

It's saying that if someone gets a hold ("be disclosed") of your known_hosts file then the host name/address will still have some privacy. AFAIK it's grammatical, but I'm open to a better wording.

 
> Also the format, described as:
> 
>     Each line in these files contains the following fields: markers
> (optional),
>     hostnames, bits, exponent, modulus, comment.
> 
> is outdated (describes RSA1 keys). In current situation the part
> "bits, exponent, modulus" is substituted by "keytype, base64-encoded
> key" as described for example in  authorized_keys  section.

How about:

-hostnames, bits, exponent, modulus, comment.
+hostnames, key type, key content (base-64 encoded), comment.

We're taking the habit of referring to SSH protocol 2 features only in anticipation of a future removal of SSH 1 code in a few years.
Comment 2 Jakub Jelen 2016-04-08 18:49:13 AEST
(In reply to Damien Miller from comment #1)
> >     Alternately, hostnames may be stored in a hashed form which hides
> >     host names and addresses should the file's contents be disclosed.
> 
> It's saying that if someone gets a hold ("be disclosed") of your
> known_hosts file then the host name/address will still have some
> privacy. AFAIK it's grammatical, but I'm open to a better wording.

I am not native, so finally I checked in the dictionary, and there is really such a meaning, but it is the first time I saw word "should" in meaning of "in case"/"if". I got the idea about the meaning, but IMHO language of manual pages does not have to be super-fancy, but rather simple if we want people to read them. Proposal:

    Alternately, hostnames may be stored in a hashed form which hides
    host names and addresses in case of the file's contents disclosure.

> -hostnames, bits, exponent, modulus, comment.
> +hostnames, key type, key content (base-64 encoded), comment.

I am fine with that. I based my proposal on the same format description in authorized_keys section:

    Protocol 2 public key consist of: options, keytype, base64-encoded key, comment. 

Your sounds better, but it would be nice to have the format consistent across manual pages (in the same words) not to confuse people more than is necessary.
Comment 3 Damien Miller 2020-01-25 18:03:59 AEDT
I've tweaked the wording of HashKnownHosts and the RSA1-specific format description is long gone
Comment 4 Damien Miller 2021-04-23 15:00:24 AEST
closing resolved bugs as of 8.6p1 release