Guest User

Untitled

a guest
May 24th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #!/usr/bin/env python
  2. import paramiko
  3. paramiko.util.log_to_file('/tmp/paramiko.log')
  4. host = "example.com"
  5. port = 22
  6. transport = paramiko.Transport((host, port))
  7. username = "root"
  8. password = "g00d"
  9. transport.connect(username = username, password = password)
  10. filepath = '/tmp/log.log'
  11. localpath = '/tmp/log.txt'
  12. sftp = paramiko.SFTPClient.from_transport(transport)
  13. sftp.get(filepath, localpath)
  14. sftp.close()
  15. transport.close()
Add Comment
Please, Sign In to add comment