Advertisement
Guest User

Untitled

a guest
Aug 30th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. import paramiko
  2.  
  3. hostname= '138.68.108.210'
  4. username = 'itsuser'
  5. port = 50684
  6. password = '-its?ch4'
  7.  
  8. try:
  9. client = paramiko.SSHClient()
  10. client.load_system_host_keys()
  11. client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
  12. client.connect(username= username, password= password, hostname= hostname, port= port)
  13. stdin, stdout, stderr = client.exec_command('uname -a')
  14.  
  15. for line in stdout.read().splitlines():
  16. print(line)
  17.  
  18. client.close()
  19. except Exception as e:
  20. print(e)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement