Advertisement
Guest User

Untitled

a guest
Mar 7th, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. import paramiko
  2. import time
  3.  
  4. ssh = paramiko.SSHClient()
  5. ssh.set_missing_host_key_policy( paramiko.AutoAddPolicy() )
  6.  
  7. ssh.connect( hostname='192.168.2.121', username='omp', password='', timeout=5, port=22 )
  8.  
  9. channel = ssh.invoke_shell()
  10.  
  11. channel.send( '<get_version/>\n' )
  12.  
  13. time.sleep(1)
  14.  
  15. output=channel.recv( 2048 )
  16. print( output )
  17.  
  18. ssh.close(
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement