pysftp

Python pysftp get_r from Linux works fine on Linux but not on Windows

雨燕双飞 提交于 2019-11-26 21:07:01
I would like to copy an entire directory structure with files and subfolders recursively using SFTP from a Linux server to a local machine (both Windows and Linux)using Python 2.7. I am able to ping the server and download the files using WinSCP from the same machine. I tried the following code, works fine on Linux but not on Windows. I tried \ , / , os.join , all gives me same error, checked permissions as well. import os import pysftp cnopts = pysftp.CnOpts() cnopts.hostkeys = None # disable host key checking. sftp=pysftp.Connection('xxxx.xxx.com', username='xxx',password='xxx',cnopts=cnopts

Verify host key with pysftp

荒凉一梦 提交于 2019-11-26 11:22:32
I am writing a program using pysftp, and it wants to verify the SSH host Key against C:\Users\JohnCalvin\.ssh\known_hosts . Using PuTTY, the terminal program is saving it to the Registry [HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\SshHostKeys] . How do I reconcile the difference between pysftp and PuTTY? My code is: import pysftp as sftp def push_file_to_server(): s = sftp.Connection(host='138.99.99.129', username='root', password='*********') local_path = "testme.txt" remote_path = "/home/testme.txt" s.put(local_path, remote_path) s.close() push_file_to_server() The Error Response I am

Python pysftp get_r from Linux works fine on Linux but not on Windows

筅森魡賤 提交于 2019-11-26 04:28:20
问题 I would like to copy an entire directory structure with files and subfolders recursively using SFTP from a Linux server to a local machine (both Windows and Linux)using Python 2.7. I am able to ping the server and download the files using WinSCP from the same machine. I tried the following code, works fine on Linux but not on Windows. I tried \\ , / , os.join , all gives me same error, checked permissions as well. import os import pysftp cnopts = pysftp.CnOpts() cnopts.hostkeys = None #