DSA Fingerprints...

Michael H. Warfield mhw at wittsend.com
Thu Feb 8 03:13:14 EST 2001


Hello,

	Questions, observations, and curiosities.

	Maybe this is something stupid or maybe I'm doing something wrong...
But...  In light of the Kurt Seifried paper on SSH and SSL, I was looking
for the finger prints on my various servers and known hosts files to have
a little crib sheet and maybe plug the list into a database on my palm pilot.
I found that ssh-keygen lists out the fingerprints of the RSA keys just fine
but fails when I try to list out fingerprints for the DSA keys, claiming
that this is not a valid key file.

] [root at alcove /root]# ssh-keygen -l -f /etc/ssh/ssh_host_dsa_key.pub
] /etc/ssh/ssh_host_dsa_key.pub is not a valid key file.
] You have new mail in /var/spool/mail/mhw
] [root at alcove /root]# ssh-keygen -l -f /etc/ssh/ssh_host_dsa_key    
] /etc/ssh/ssh_host_dsa_key is not a valid key file.
] [root at alcove /root]# ssh-keygen -d -l -f /etc/ssh/ssh_host_dsa_key.pub
] /etc/ssh/ssh_host_dsa_key.pub is not a valid key file.
] [root at alcove /root]# ssh-keygen -d -l -f /etc/ssh/ssh_host_dsa_key    
] /etc/ssh/ssh_host_dsa_key is not a valid key file.

] [mhw at alcove mhw]$ ssh-keygen -l -f .ssh/known_hosts2
] ssh-keygen -l -f .ssh/known_hosts2
] .ssh/known_hosts2 is not a valid key file.

	Tried against both the public and private key and both with and
without the -d option.  (Which should only be required for generating keys
anyways, right?)  Plus I tried it against a personal known_hosts2 file.

	The man page says nothing about the "-l" option being for
RSA keys only.

	Is this just "not applicable" (yes, I know the KS paper
only referred to the SSH 1 protocol, and this is for the SSH 2 protocol)
or should I be doing something else, or has something gotten missed in
ssh-keygen?

	I also thought that OpenSSH is suppose to display the system
fingerprint the first time you connect to a system:

	From my workstation Alcove to my Sparc Station Valley:

] [mhw at alcove mhw]$ ssh -V
] SSH Version OpenSSH_2.3.0p1, protocol versions 1.5/2.0.
] [mhw at alcove mhw]$ rm .ssh/known_hosts
] You have new mail in /var/spool/mail/mhw
] Compiled with SSL (0x0090600f).
] [mhw at alcove mhw]$ ssh valley.wittsend.com
] Warning: Permanently added 'valley.wittsend.com,130.205.0.39' (RSA) to the list of known hosts.
] mhw at valley.wittsend.com's password:
 
] [mhw at alcove mhw]$ ssh -2 valley.wittsend.com
] Warning: Permanently added 'valley.wittsend.com,130.205.0.39' (DSA) to the list of known hosts.
] mhw at valley.wittsend.com's password:

	Tried from another systems:

	From my server Wittsend to my Sparc Station Valley:

] [mhw at wittsend mhw]$ ssh -V
] SSH Version OpenSSH_2.3.0p1, protocol versions 1.5/2.0.
] Compiled with SSL (0x0090581f).
] [mhw at wittsend mhw]$ ssh valley.wittsend.com
] The authenticity of host 'valley.wittsend.com' can't be established.
] RSA key fingerprint is c8:0a:8c:43:de:66:2c:6b:2d:94:71:64:4e:21:60:b8.
] Are you sure you want to continue connecting (yes/no)? yes
] Warning: Permanently added 'valley.wittsend.com,130.205.0.39' (RSA) to the list of known hosts
] mhw at valley.wittsend.com's password:

] [mhw at wittsend mhw]$ ssh -2 valley.wittsend.com
] The authenticity of host 'valley.wittsend.com' can't be established.
] DSA key fingerprint is 21:db:c5:53:54:5c:97:f8:2e:45:5d:57:7d:f7:19:27.
] Are you sure you want to continue connecting (yes/no)? yes
] Warning: Permanently added 'valley.wittsend.com,130.205.0.39' (DSA) to the list of known hosts.
] mhw at valley.wittsend.com's password:

	So why did one system display the fingerprints (both protocols)
and the other system didn't (neither protocols)?  Valley is unknown in
the global known_hosts file in each case and in each case I get an
announcement about adding the host to the know_hosts file.  I can't find
any difference in my configurations that would prompt this difference
in behavior, either.

	Concerning the known_hosts files...

	I've found that occasionally I end up with multiple lines with the
same key (just different host names or addresses) and sometimes I end up
with single lines with multiple names separated by commas, and sometimes
both.

	Is either format preferable over the other?

	Any reason why NOT to collapse entries with identical keys to
a single line?

	Any reason why NOT to expand all of them to one name or address
per line?

	My personal known_hosts file has over 100 entries and, in a
few cases, has duplicate entries (identical lines in every respect including
whitespace.  In one particular case, I have four consecutive identical
lines in that file.

] [mhw at alcove mhw]$ sort -u < .ssh/known_hosts > .ssh/known_hosts.u
] [mhw at alcove mhw]$ wc .ssh/known_hosts .ssh/known_hosts.u
]     104     416   34670 .ssh/known_hosts
]      93     372   31002 .ssh/known_hosts.u
]     197     788   65672 total

	Any clue why this might happen?

	This is currently with OpenSSH 2.3.0p1, but I've been using SSH
since ssh-1.1.8 (yes, 1.1, not 1.2) days, so there may be some hold over
data (like 1023 bit keys and such) from previous ancient versions.

	Last question...  Given SecureDNS as a predicate (ok...  Oxymoron
with most of the DNS out there, but I have several in several zones.) and
given that we can publish keys in the DNS, can OpenSSH use them to validate
the host keys?  I can do with with FreeS/WAN (Linux IPSec) where I specify
to use the host public key from DNS, I was just wondering if that is
possible or planned for SSH as well.  For zones under my total control,
that simplifies my host key management immensely (which is a point in
the KS paper).

	Regards,
	Mike
-- 
 Michael H. Warfield    |  (770) 985-6132   |  mhw at WittsEnd.com
  (The Mad Wizard)      |  (678) 463-0932   |  http://www.wittsend.com/mhw/
  NIC whois:  MHW9      |  An optimist believes we live in the best of all
 PGP Key: 0xDF1DD471    |  possible worlds.  A pessimist is sure of it!






More information about the openssh-unix-dev mailing list