Guest User

Untitled

a guest
Feb 16th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3. import paramiko
  4.  
  5. hostname = 'localhost'
  6. port = 22
  7. username = 'foo'
  8. password = 'xxxYYYxxx'
  9.  
  10. if __name__ == "__main__":
  11. paramiko.util.log_to_file('paramiko.log')
  12. s = paramiko.SSHClient()
  13. s.load_system_host_keys()
  14. s.connect(hostname, port, username, password)
  15. stdin, stdout, stderr = s.exec_command('ifconfig')
  16. print stdout.read()
  17. s.close()
Add Comment
Please, Sign In to add comment