1

I want to login in different machine in the network and copy a file from that machine to my machine.I want to do this using python.Any idea how can i do this .I have python 2.5 a nd ubuntu 8.10

Tobu
  • 24,771
  • 4
  • 91
  • 98
ha22109
  • 8,036
  • 13
  • 44
  • 48

2 Answers2

5

Use subprocess and call scp directly. This has the advantage of using your ssh settings, private keys and agent.

Look into Fabric if you need a more structured framework for doing local and remote operations.

Tobu
  • 24,771
  • 4
  • 91
  • 98
0

get paramiko or similar libraries.

Francis
  • 11,388
  • 2
  • 33
  • 37
  • i have install paramiko but when type import paramiko in python shell it gives me error ImportError "No module named Crypto.Util.randpool" File: /usr/lib/python2.5/site-packages/paramiko/rng.py, Then i downloaded the PyCrypto tar but it is not installing up – ha22109 Jan 14 '10 at 05:56