I'm using Python 3, on Windows, and using pysftp.
Basically, I'm looking for very simple way in Python to connect to an SFTP server and save it's host key to a file that can be used with pysftp in the future.
Some quick notes:
I know I can set hostkeys = None in pysftp to bypass the problem when connecting to do actual normal ftp functions (upload, download, etc). I'd rather not do that.
Sample sftp public servers can be found here if you want to test anything: https://www.sftp.net/public-online-sftp-servers
I know there are other programs that can do this for me (for instance, multiple ftp clients). I'm explicitly looking to do this in Python code, in the simplest way possible.
Any help would be very appreciated. :-)