Advertisement
Guest User

Untitled

a guest
Oct 13th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. from fs.sshfs import SSHFS
  2.  
  3. host = '192.168.1.10'
  4. remote_path = '/home/jovyan/dev/test-fs-sshfs/requirements.txt'
  5.  
  6. remote_fs = SSHFS(
  7. host, user='david', passwd='test', pkey=None, timeout=10, port=22,
  8. keepalive=10, compress=False, config_path='~/.ssh/config'
  9. )
  10.  
  11. remote_file = remote_fs.openbin(remote_path)
  12. line = remote_file.readline()
  13. while line:
  14. try:
  15. line = line.decode('utf8')
  16. print (line.strip())
  17. except:
  18. pass
  19. line = remote_file.readline()
  20. remote_file.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement