I\'m trying to get started with the Paramiko library, but the library is throwing an exception as soon as I try to connect with the following simple program:
I had this error: I can connect from the shell, but paramiko says "Unknown server workdevel114".
There were two similar entries in known_hosts:
user@host> grep workdevel114 ~/.ssh/known_hosts
workdevel114 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQC8qGbuI1BaBodi7sKWLfV8Eh+De80Th7HFLD4WiJWo57THl0Q+QcopUaU3pF....
user@host> grep I1BaBodi7sKWLfV8Eh+De80Th7HFLD4WiJWo57THl0Q+QcopUaU3pF ~/.ssh/known_hosts
workdevel114 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQC8qGbuI1BaBodi7sK...
|1|f/auQ9nY5dFbVtOdY3ocjtVO9dM=|esvazUDTT3VIcLk9DxmPI6FZt1s= ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQC8qGbuI1BaBodi7sKWLfV8Eh+De80Th7HFLD4...
The seconds entry (|1|....) seems to confuse paramiko. I guess it is related to this ticket: https://github.com/paramiko/paramiko/issues/67
I solved it by adding this line:
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
But this disables host-checking of the ssh protocol in this case: Paramiko thinks the host key is unknown, but it is known. The known Key gets ignored. I don't care because man-in-the-middle attacks are very unlikely in my environment.
paraiko-version: 1.7.7.1-1ubuntu1