Advertisement
Guest User

Untitled

a guest
May 16th, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. import paramiko
  2. import os
  3.  
  4. hostname = "student.agh.edu.pl"
  5. port = 22
  6. username = "wrachwal"
  7. password = "2Defe*kac"
  8.  
  9. local_path = 'path.txt'
  10. remote_path = 'python/path.txt'
  11.  
  12. client = paramiko.SSHClient()
  13. client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
  14. client.connect(hostname, port, username, password)
  15.  
  16. sftp = client.open_sftp()
  17. sftp.put(local_path, remote_path)
  18.  
  19. sftp.close()
  20. client.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement