In ssh
clients, file .ssh/knwon_hosts
may use plain text (this happens, for example, in FreeBSD 12.0):
<ip_address> ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEIlD8R6Kxj9CdToar+3ay4B0yE65dP0EYoRJjEEgLjmvCTIv59DBp+0j2z0+NM0hxxJew79i1bYuN02lEvT2/E=
or it may be hashed (as in Ubuntu 18.04):
|1|3Et6QShrP2OrD4tWdOGP3jy3YC4=|f2FrJ5tOjjmFSrGWyen1DokJyLc= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBIyZLGNvIADWL5SSkohBmDCVpLUzAHNejqQAXP3SSY300YIdNKCn3jqGmFAJiKB1CY0HnVirgFjdAKpyw3+6yzo=
Question 1
Is it possible to obtain the plain text lines from an hashed known_hosts
?
Ubuntu sshd manpage states that:
Only one hashed hostname may appear on a single line and none of the above negation or wildcard operators may be applied.
I am not sure about what it's meant here.
Question 2
Does that mean that addresses like 192.168.*.*
can never be accepted in the hashed form of known_hosts
, even when they are created as plain text and then manually hashed?
As in a previous question, I am using these clients: OpenSSH_7.8p1, OpenSSL 1.1.1a-freebsd 20 Nov 2018
and OpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n 7 Dec 2017
.
HashKnownHosts
is set toyes
orno
in the configuration, not which distribution or unix-like OS you are using (although different distributions may set different values in the default ssh_config). – user4556274 May 27 '19 at 16:35