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
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.