Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. def abc(username, password, host, a, b, c, d, e):
  2.  
  3. # VARIABLES THAT NEED CHANGED
  4.  
  5. # Create instance of SSHClient object
  6. remote_conn_pre = paramiko.SSHClient()
  7.  
  8. # Automatically add untrusted hosts (make sure okay for security policy in your environment)
  9. remote_conn_pre.set_missing_host_key_policy(
  10. paramiko.AutoAddPolicy())
  11.  
  12. # initiate SSH connection
  13. remote_conn_pre.connect(host, username=username, password=password, look_for_keys=False, allow_agent=False)
  14. print "SSH connection established to %s" % host
  15. # Use invoke_shell to establish an 'interactive session'
  16. remote_conn = remote_conn_pre.invoke_shell()
  17.  
  18. # Send some commands and get the output
  19.  
  20. def xyz(username, password, host, a, b):
  21.  
  22. # VARIABLES THAT NEED CHANGED
  23.  
  24. # Create instance of SSHClient object
  25. remote_conn_pre = paramiko.SSHClient()
  26.  
  27. # Automatically add untrusted hosts (make sure okay for security policy in your environment)
  28. remote_conn_pre.set_missing_host_key_policy(
  29. paramiko.AutoAddPolicy())
  30.  
  31. # initiate SSH connection
  32. remote_conn_pre.connect(host, username=username, password=password, look_for_keys=False, allow_agent=False)
  33. print "SSH connection established to %s" % host
  34. # Use invoke_shell to establish an 'interactive session'
  35. remote_conn = remote_conn_pre.invoke_shell()
  36.  
  37. # Send some commands and get the output
  38.  
  39. def abc(username, password, host, a, b, c, d, e)
  40.  
  41. def xyz(username, password, host, a, b):
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement