Доброго времени суток, пытаюсь скачать файл с linux хоста на win но получаю след. ошибку:
C:\Program Files\Microsoft SQL Server\MSSQL11.SQLEXPRESS\MSSQL\Backup>p.py
C:\Users\admin\AppData\Local\Programs\Python\Python38\lib\site-packages\pysftp\_
_init__.py:61: UserWarning: Failed to load HostKeys from C:\Users\admin\.ssh\kno
wn_hosts. You will need to explicitly load HostKeys (cnopts.hostkeys.load(filen
ame)) or disableHostKey checking (cnopts.hostkeys = None).
warnings.warn(wmsg, UserWarning)
Traceback (most recent call last):
File "C:\Program Files\Microsoft SQL Server\MSSQL11.SQLEXPRESS\MSSQL\Backup\p.
py", line 15, in
with pysftp.Connection(host=myHostname, username=myUsername, password=myPass
word, port=myPort) as sftp:
File "C:\Users\admin\AppData\Local\Programs\Python\Python38\lib\site-packages\
pysftp\__init__.py", line 132, in __init__
self._tconnect['hostkey'] = self._cnopts.get_hostkey(host)
File "C:\Users\admin\AppData\Local\Programs\Python\Python38\lib\site-packages\
pysftp\__init__.py", line 71, in get_hostkey
raise SSHException("No hostkey for host %s found." % host)
paramiko.ssh_exception.SSHException: No hostkey for host 192.168.2.11 found.
Exception ignored in:
Traceback (most recent call last):
File "C:\Users\admin\AppData\Local\Programs\Python\Python38\lib\site-packages\
pysftp\__init__.py", line 1013, in __del__
self.close()
File "C:\Users\admin\AppData\Local\Programs\Python\Python38\lib\site-packages\
pysftp\__init__.py", line 784, in close
if self._sftp_live:
AttributeError: 'Connection' object has no attribute '_sftp_live'
Вот код:
import pysftp
myHostname = "192.168.2.11"
myUsername = "admin"
myPassword = "pwd"
myPort = "22"
with pysftp.Connection(host=myHostname, username=myUsername, password=myPassword, port=myPort) as sftp:
print ("Connection succesfully stablished ... ")
remoteFilePath = '/share/MD0_DATA/MSSQL/Backup.bak'
localFilePath = 'C:/'
sftp.get(remoteFilePath, localFilePath)
Что нужно добавить/поправить чтобы заработало? Спасибо