0

I need to connect to secure FTP server from windows-7 machine. I have user credentials to login to the server and its working when i secure ftp using winscp.

I have tried using the pysftp.connection() but its failing for host_keys loading.

import pysftp

try: sftp = pysftp.Connection('zzz.yyy.com', username='usr_nm', password='xxxxx') except Exception as err: print('sftp failed', str(err))

below is the error message...

sftp failed No hostkey for host zzz.yyy.com found. C:\ProgramData\Anaconda3\lib\site-packages\pysftp__init__.py:61: UserWarning: Failed to load HostKeys from C:\Users\ppp.ssh\known_hosts. You will need to explicitly load HostKeys (cnopts.hostkeys.load(filename)) or disableHostKey checking (cnopts.hostkeys = None).

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
Kumar P
  • 13
  • 2
  • Possible duplicate of [Verify host key with pysftp](https://stackoverflow.com/questions/38939454/verify-host-key-with-pysftp) – Martin Prikryl May 08 '19 at 13:42
  • Particularly see [my answer to the question](https://stackoverflow.com/q/38939454/850848#43389508). The most voted answer is wrong. – Martin Prikryl May 08 '19 at 13:43

0 Answers0