Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/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()
Add Comment
Please, Sign In to add comment