Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import datetime, logging, os, paramiko, re, scp, sys, time, socket, logging
- SSH = paramiko.SSHClient()
- SSH.set_missing_host_key_policy(paramiko.AutoAddPolicy())
- SSH.connect(server, username=usr, password=password, port=22, timeout=2)
- print('successful ssh')
- stdin, stdout, stderr = SSH.exec_command('cli console',bufsize=2)
- # inBuf = stdout.readlines()
- # for line in inBuf:
- # print(line.strip('n'))
- SSH.close()
- stdin.write('commandn')
- stdin.flush()
Add Comment
Please, Sign In to add comment