3

I am SSHing to a server via Cygwin's SSH and via Ubuntu 14.04's SSH.

  • Cygwin version: OpenSSH_7.1p2, OpenSSL 1.0.2e 3 Dec 2015
  • Ubuntu version: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.4, OpenSSL 1.0.1f 6 Jan 2014

When I connect to a server on our network by IP I get the following:

On Cygwin:

Host key fingerprint is SHA256:0F6lOu97wCE/BSQZxLNzGNVsHfilI9EobN6nZEKPr+Y
+---[RSA 2048]----+
|       o+*oo.=.. |
|       .=.*oB o .|
|      . .OoB o o |
|       o=o* B =  |
|        S* B + . |
|         o= o    |
|          .+     |
|         .o .    |
|         oEo     |
+----[SHA256]-----+

On Ubuntu:

Host key fingerprint is a8:87:04:f8:94:ab:d4:3b:39:4c:68:a9:b1:1e:c7:02
+--[ RSA 2048]----+
|                 |
| . .             |
|. +              |
| o+o   .         |
|E=oo. . S        |
|=++.oo           |
|+o Oo .          |
|. + o.           |
| .               |
+-----------------+

The host key fingerprints appear to be different formats, which is fine. However what I'm worried about is that the VisualHostKey is different. Is this to be expected?

  • Client implementation will differ with the format they choose to display the fingerprint. – RoraΖ Feb 4 '16 at 16:20
2

The problem is in the thing, that the randomart is based on the fingerprint and not on the key itself. This implies that the hashes are different and therefore the ASCII arts too. For example my output when using the same client version and same key:

Host key fingerprint is SHA256:v0I6xgzhRSheT19KVcglIbLven9u/xAaVC/GlpjODpo
+---[ECDSA 256]---+
|     .. .o+=o .  |
|  . o oo..+. = o |
| . o +.o o  + * .|
|  . . o.o  + o . |
|   . o  S . + .  |
|    o  ..+ o o . |
|     + oE . o .  |
|      *.o  .o  . |
|     ..o oo+.....|
+----[SHA256]-----+
Host key fingerprint is MD5:22:0c:a2:6b:87:80:26:ee:0f:5c:62:1d:5c:e1:cd:48
+---[ECDSA 256]---+
|     E.          |
|  . + +          |
|. .o o o         |
|o..o.            |
|=+ oo . S        |
|B.+  . .         |
|.* .             |
|o o              |
| ...             |
+------[MD5]------+

The root of the change is that md5 is obsolete and new verison uses sha256 by default. But still you can force the client to use the md5 version, which should result in the same randomart:

ssh -oFingerprintHash=md5 you_host

or with the option in ssh_config:

FingerprintHash md5
0

Looking at the source code and as far as I can see, its completely random.

A note from the documentation:

If you see the picture is different, the key is different.
If the picture looks the same, you still know nothing.
The algorithm used here is a worm crawling over a discrete plane, leaving a trace (augmenting the field) everywhere it goes.
Movement is taken from dgst_raw 2bit-wise. Bumping into walls makes the respective movement vector be ignored for this turn.
Graphs are not unambiguous, because circles in graphs can be walked in either direction.

If you need to, you can disable the VisualHostKeys by editing the config file (usually ~/.ssh/config):

Host *
    VisualHostKey       yes

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.