1

I am trying to copy a folder(Directory) from the remote machine to the local machine.

import paramiko
import os
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect("IP", username="root", password="password")
sftp = ssh.open_sftp()
remote_path = '/tmp/'
local_path = 'D:\\Test\\tmp'
sftp.get(remote_path, local_path)

But, the problem I am facing is, I am unable to copy the entire folder. Can someone suggest me the modules which I can use for copying the entire directory from remote linux/Windows machine to local windows machine.

Surya G
  • 25
  • 7
  • Particularly see, [my answer](https://stackoverflow.com/q/6674862/850848#53556194) (posted just now) and the answer by [@DanLaManna](https://stackoverflow.com/q/6674862/850848#15932241). – Martin Prikryl Nov 30 '18 at 11:00
  • Also see [Python pysftp get_r from Linux works fine on Linux but not on Windows](https://stackoverflow.com/q/50118919/850848). – Martin Prikryl Nov 30 '18 at 11:02

0 Answers0