Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import paramiko
- ssh_client = paramiko.SSHClient()
- hostname = 'test.rebex.net'
- username = 'demo'
- password = 'password'
- port = '22'
- file = 'readme.txt'
- ssh_client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
- ssh_client.connect(hostname, port, username, password)
- print('connected to server')
- remotepath = '/'
- localpath = 'c:/users/ME/documents/file.txt'
- #download file
- ftp_client = ssh_client.open_sftp()
- ftp_client.get(remotepath + file, localpath)
- ftp_client.close()
- print('winning')
Add Comment
Please, Sign In to add comment