Skip to content

Known_hosts with multiple fingerprints per host #737

Closed

Description

@Benoit-DunandLaisin

My known_host file is configured to handle a cluster, I mean a "node-a" and a "node-b" in active/passive mode. I access to the active node through the hostname "node-vip".
However in this configuration, Paramiko (1.16.0) failed to connect through "node-vip" because of fingerprint mismatch.

Here is my known_host file:

node-a, node-vip ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAxrw4fYk6RQ7r0QGxcH4TrQr4MuFjWBGao/akYnnKnzE4KiIzrV0x6n4/7XCu5bHUPUPeeDVtals3Ku8Vzg5neFYcbopgJNW5zX8oVnTBAyHNZc6lIKw0Fhoj/BRD6Ufj0eEfvTTfo0+7+9RnTIOfeXKDxhI4MkdNaVjn88e2lEuelL4b31N5iL6tPfyTsI2tpNk7EGb3cnW85/+LisecqjhgBRKZATu9nBc9t02FBWdXAIjntQMUCjcaIepdPrXf5A5e76toQHFaFBQDcfMA48OGiTuAK98aWtrgHdl7/2Xhz/3sOzgWWqVI3Z4kDWSYfzB8IWsYjHoQtH59GyW0ww==
node-b, node-vip ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAza3vXq0VBnVZkLqJMe2BFJjfpk6HdIgVeGb1Xg0a4mw3OTnVE03O4Iw4KOAMCZhke8f//MIztEIQ1+TlqKVa8aDKx3dFXFXbfst9lgSzFjspnfl6lwvKdBNnVWa6qiZ4AyQJAVcqcRGwi34mCei7CwpZDVfIG1JHL+gDU7Xdvv86SK3X7h2HeBdCwJWvGKKxFjFovjpf9yqTBazn6SXkgYp2Uy+o02OGBCrPGeGNCrwKdVNviS3m5I0aNZyofSrdiu62LEBv0sUOl4JLc1Xc1yS30GBxJrrRLAZDhBOM0/gc576WXYh4tSYGrzNO2EnS/6ACM8FveeTiS17qYcmvDw==

Here is the python code that shows the problem:

import paramiko
client = paramiko.SSHClient()
client.load_host_keys('known_hosts')
keys = client.get_host_keys()
x = keys.lookup('node-vip')
x.items()

The last command returns:

[('ssh-rsa', <paramiko.rsakey.RSAKey at 0x7ff1d44e52d0>),
 ('ssh-rsa', <paramiko.rsakey.RSAKey at 0x7ff1d44e52d0>)]

So 2 entries is fine but two times the same entry is not.

Activity

  1. changed the title [-]Know_hosts with multiple fingerprint per hosts[/-] [+]Known_hosts with multiple fingerprints per host[/+] on May 2, 2016
  2. bitprophet commented on May 5, 2016

    @bitprophet
    Member

    This seems like the same issue as #138 to me, rolling it into there as another (clearly documented - thanks!) use case.

  3. Benoit-DunandLaisin commented on May 6, 2016

    @Benoit-DunandLaisin
    Author

    Hi, I confirm #138 is the same issue. Sorry to missed it before opening a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions