Advertisement
Guest User

Untitled

a guest
Oct 25th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3. from Exscript.util.interact import read_login
  4. from Exscript.protocols import SSH2
  5. import sys
  6.  
  7. def main():
  8. account = read_login()
  9. conn = SSH2()
  10. conn.connect('10.28.254.2')
  11. conn.login(account)
  12. conn.execute('config global')
  13. conn.set_prompt('.*login:')
  14. conn.execute('execute ha manage 1')
  15. print conn.response
  16. conn.set_prompt('Password:')
  17. conn.execute(account.name)
  18. print conn.response
  19. conn.set_prompt()
  20. conn.execute(account.password)
  21. print conn.response
  22.  
  23. if __name__ == "__main__":
  24. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement