Advertisement
Guest User

Untitled

a guest
Mar 30th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. import paramiko
  2. sshclient = None
  3. try:
  4. sshclient = paramiko.SSHClient()
  5. sshclient.set_missing_host_key_policy(paramiko.AutoAddPolicy())
  6. sshclient.connect('dm-j-9513-1', username='admin', password='admin1234')
  7. chan = sshclient.get_transport().open_session(window_size=500000)
  8. chan.settimeout(10800)
  9. chan.exec_command('show tech-support fcip')
  10.  
  11. value = chan.recv(1024)
  12. while value:
  13. print(value)
  14. value = chan.recv(1024)
  15.  
  16. finally:
  17. if sshclient:
  18. sshclient.close()
  19.  
  20. Authentication (password) successful!
  21. [chan 0] Max packet in: 32768 bytes
  22. [chan 0] Max packet out: 32768 bytes
  23. Secsh channel 0 opened.
  24. [chan 0] Sesch channel 0 request ok
  25. EOF in transport thread
  26.  
  27. Authentication (password) successful!
  28. [chan 0] Max packet in: 32768 bytes
  29. [chan 0] Max packet out: 32768 bytes
  30. Secsh channel 0 opened.
  31. [chan 0] Sesch channel 0 request ok
  32. [chan 0] EOF received (0)
  33. EOF in transport thread
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement