1

I read this, says 'with more specific hostmasks taking precedence', but when I tried, the output is not what the documentation says:

>>> from paramiko.config import SSHConfig
>>> ssh_config = SSHConfig()
>>> ssh_config.parse(open('/tmp/ssh_config'))
>>> import pprint
>>> pprint.pprint(ssh_config._config)
[{'config': {}, 'host': ['*']},
 {'config': {'port': '22'}, 'host': ['*']},
 {'config': {'port': '23'}, 'host': ['*.example.com']}]
>>> ssh_config.lookup('ssh.example.com')
{'hostname': 'ssh.example.com', 'port': '22'}

In the example above, the port for ssh.example.com should be 23(the more specific one i.e. *.example.com, not *). Any one to clear out this for me? Thanks. I read through the code, but found nothing dealing with this kind of precedence.

schemacs
  • 2,783
  • 8
  • 35
  • 53

0 Answers0