Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import paramiko
- def fun1():
- try:
- ssh = paramiko.SSHClient()
- ssh.load_system_host_keys()
- ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
- ssh.connect(ip,username=username,password=password)
- except Exception as err:
- print err
- while True: #while time.time() - start < 3:
- if session.recv_ready():
- data = session.recv(1024)
- sys.stdout.write(data)
- sys.stdout.flush() # Flushing is important!
- time.sleep(0.001) # Yield CPU so we don't take up 100% usage...
- sys.stdout.write('n')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement