robey/paramiko — Issue #46: Why is the server unknown?
Author: bortzmeyer
Created: 2011-10-13 13:13:09+00:00
State: open

There is a machine where I log in daily from the command line. So, I'm certain its key is in the OpenSSH files. But Paramiko does not find it:

>>> client = paramiko.SSHClient()
>>> client.load_system_host_keys()
>>> client.load_host_keys("/home/stephane/.ssh/known_hosts")
>>>
>>> client.connect("www.example.com, 3442)
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/pymodules/python2.6/paramiko/client.py", line 311, in connect
self._policy.missing_host_key(self, server_hostkey_name, server_key)
File "/usr/lib/pymodules/python2.6/paramiko/client.py", line 85, in missing_host_key
raise SSHException('Unknown server %s' % hostname)
paramiko.SSHException: Unknown server [www.example.com]:3442

It happens with every host I tried.

This is on Debian "squeeze", the stable version.

Python 2.6.6 (r266:84292, Dec 27 2010, 00:02:40)
[GCC 4.4.5] on linux2

Paramiko 1.7.6