Advertisement
Guest User

Untitled

a guest
Jun 9th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3. import paramiko
  4. import sys
  5.  
  6. host=raw_input("Digite o host:")
  7. user=raw_input('Digite o usuario: ')
  8. senha=raw_input('Digite a senha:')
  9.  
  10.  
  11. def usage():
  12. print "Digite host,usuario e senha"
  13.  
  14.  
  15.  
  16. #def conn():
  17. client = paramiko.SSHClient()
  18. addpolicy = paramiko.AutoAddPolicy()
  19. client.set_missing_host_key_policy(addpolicy)
  20. client.connect(host, username=user, password=senha)
  21. stdin, stdout, stderr = client.exec_command('uname -a')
  22. data = stdout.read()
  23. for line in data:
  24. if line.startswith(''):
  25. print line.splitlines()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement