Guest User

Untitled

a guest
Jun 12th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. import datetime, logging, os, paramiko, re, scp, sys, time, socket, logging
  2.  
  3. SSH = paramiko.SSHClient()
  4. SSH.set_missing_host_key_policy(paramiko.AutoAddPolicy())
  5. SSH.connect(server, username=usr, password=password, port=22, timeout=2)
  6. print('successful ssh')
  7. stdin, stdout, stderr = SSH.exec_command('cli console',bufsize=2)
  8. # inBuf = stdout.readlines()
  9. # for line in inBuf:
  10. # print(line.strip('n'))
  11.  
  12. SSH.close()
  13.  
  14. stdin.write('commandn')
  15. stdin.flush()
Add Comment
Please, Sign In to add comment