1

Please let me know how do I use paramiko module to transfer files between two remote hosts.

I have seen that 'get' method will get the files from remote host to local host. 'put' method will put the local files to some remote host.

Is there any method that combines 'get' and 'put' methods i.e.get files from remote host and put it in remote host. This request will get initiated from localhost.

Kalyan Kumar
  • 111
  • 13
  • had u look on this https://stackoverflow.com/questions/14625509/python-transfer-a-file-between-two-remote-servers-excecuting-a-python-script – pankaj mishra Dec 04 '17 at 07:30

1 Answers1

0

Paramiko.sftp_client.SFTPClient provides SFTP (Secure File Transfer Protocol) features to move files between computers. After starting an sftp session via

ssh = client.open_sftp(),

you can access all of these methods.

If you just want to move files on the remote host, then you can use "local" file transfer methods with shutil. Hope that helped!

I. Amon
  • 174
  • 11
  • I think I musinderstood your question: If you could start a method from the localhost on the remote host that makes the remote host act as a client to the second remote host, using paramikos `SFTP` features, you would be able to solve your problem directly. – I. Amon Dec 04 '17 at 09:17