0

I am trying to push a file using SFTP protocol. I am using Python3 with pysftp library. The code is very simple:

host = "100.100.100.1" #the host ip 
passw = "myPass" #password
user = "myUser" #username
path = "/destination/"    
localpath = "D:/myFolder/"

sftp =  pysftp.Connection(host, username=user, password=passw) 
sftp.put(localpath, path)
sftp.close()   

however as result I have this error message:

No hostkey for host 100.100.100.1 found

What am I doing wrong? Naturally the ip address and other sensible data in the example code are not real. Thank you for the help.

Ezecamele
  • 31
  • 4
  • What you are doing wrong, is that you haven't even tried to google the error you are getting. As this has been asked zillion times already. See [Verify host key with pysftp](https://stackoverflow.com/q/38939454/850848). – Martin Prikryl Jan 15 '21 at 16:11
  • Btw, once you fix the host key issue, you will find out that your `put` code is wrong too. But that's for separate question. – Martin Prikryl Jan 15 '21 at 16:23

0 Answers0