“Failed to load HostKeys” warning while connecting to SFTP server with pysftp

前端 未结 1 672
萌比男神i
萌比男神i 2020-12-06 15:15

I wrote a Python script to connect to SFTP server using key authentication. It connects to server successfully but shows the following warning (see below). What does it mean

相关标签:
1条回答
  • 2020-12-06 15:54

    I believe it's a bug in pysftp. You get this everytime you use cnopts.hostkeys = None (despite the warning actually suggesting to use that).

    Anyway, you should not use cnopts.hostkeys = None, you lose security by doing so.
    For the correct solution, see Verify host key with pysftp.


    By your reference to key authentication, I assume you mistake your account key with host key. Read my article about SSH key pairs to understand the difference.

    0 讨论(0)
提交回复
热议问题