Skip to content

Instantly share code, notes, and snippets.

@luisuribe
Created April 28, 2010 13:44
Show Gist options
  • Save luisuribe/382154 to your computer and use it in GitHub Desktop.
Save luisuribe/382154 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import paramiko
paramiko.util.log_to_file('/tmp/paramiko.log')
host = "example.com"
port = 22
transport = paramiko.Transport((host, port))
username = "root"
password = "g00d"
transport.connect(username = username, password = password)
filepath = '/tmp/log.log'
localpath = '/tmp/log.txt'
sftp = paramiko.SFTPClient.from_transport(transport)
sftp.get(filepath, localpath)
sftp.close()
transport.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment