I have previously connected to a clients SFTP through vb.net script with WinSCP which has worked successfully however I don't want to use WinSCP. I am newish to Python but think for my overall goal for the project will be better suited using python.
What I believe I am missing is potentially a public key and/or my privatekey is in the wrong format. Would really appreciate some help on this as I have been stuck for days trying different things.
import pysftp
myHostname = 'sftp.name.com'
myUsername = 'username'
myPassword = 'password'
myKey = 'C:\\PrivateKey.ppk'
with pysftp.Connection(host=myHostname, username=myUsername, private_key=myKey, private_key_pass=myPassword) as sftp:
Error received
UserWarning: Failed to load HostKeys from C:\Users\name\.ssh\known_hosts.