known-hosts

pysftp.CnOpts() 'No Host Keys Found' error despite known_hosts file generated using ssh-keyscan

让人想犯罪 __ 提交于 2021-02-08 08:52:26
问题 I am trying to follow solution from Verify host key with pysftp. I run: import pysftp fn = r'C:\Users\UWAdmin\.ssh\known_hosts' cnopts = pysftp.CnOpts() cnopts.hostkeys.load(fn) but I get the error: HostKeysException Traceback (most recent call last) <ipython-input-3-b5b4d53fef6c> in <module> ----> 9 cnopts = pysftp.CnOpts() 10 cnopts.hostkeys.load(fn) ~\miniconda3\envs\pycontrol\lib\site-packages\pysftp\__init__.py in __init__(self, knownhosts) 62 else: 63 if len(self.hostkeys.items()) == 0: