Advertisement
Guest User

Untitled

a guest
Aug 20th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. import pysftp
  2. s = pysftp.Connection(host='test.rebex.net', username='demo', password='password')
  3. data = s.listdir()
  4. s.close()
  5. for i in data:
  6. print i
  7.  
  8. pip install -u pysftp
  9.  
  10. ssh test.rebex.net
  11.  
  12. import pysftp
  13. cnopts = pysftp.CnOpts()
  14. cnopts.hostkeys = None # disable host key checking.
  15. with pysftp.Connection('host', username='me',private_key=private_key,
  16. private_key_pass=private_key_password,
  17. cnopts=cnopts) as sftp
  18. # do stuff here
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement