0

I am working on the following python code to download files using pysftp

import pysftp

host = 'xxx.yyy.solutions'
port = 22
username = 'Abc.xyz'
password= '1234_abcd$'
cnopts=pysftp.CnOpts()

cnopts = pysftp.CnOpts(knownhosts='known_hosts')
conn = pysftp.Connection(host=host,username=username, password=password,cnopts=cnopts)

But the above code generates an exception

pysftp.exceptions.HostKeysException: No Host Keys Found

The ssh-keyscan 'xxx.yyy.solutions' command shows the output as

ssh-keyscan out put

vinu thomas
  • 373
  • 6
  • 17
  • Does this answer your question? [Verify host key with pysftp](https://stackoverflow.com/questions/38939454/verify-host-key-with-pysftp) – Martin Prikryl Mar 16 '22 at 17:29

0 Answers0