Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def abc(username, password, host, a, b, c, d, e):
- # VARIABLES THAT NEED CHANGED
- # Create instance of SSHClient object
- remote_conn_pre = paramiko.SSHClient()
- # Automatically add untrusted hosts (make sure okay for security policy in your environment)
- remote_conn_pre.set_missing_host_key_policy(
- paramiko.AutoAddPolicy())
- # initiate SSH connection
- remote_conn_pre.connect(host, username=username, password=password, look_for_keys=False, allow_agent=False)
- print "SSH connection established to %s" % host
- # Use invoke_shell to establish an 'interactive session'
- remote_conn = remote_conn_pre.invoke_shell()
- # Send some commands and get the output
- def xyz(username, password, host, a, b):
- # VARIABLES THAT NEED CHANGED
- # Create instance of SSHClient object
- remote_conn_pre = paramiko.SSHClient()
- # Automatically add untrusted hosts (make sure okay for security policy in your environment)
- remote_conn_pre.set_missing_host_key_policy(
- paramiko.AutoAddPolicy())
- # initiate SSH connection
- remote_conn_pre.connect(host, username=username, password=password, look_for_keys=False, allow_agent=False)
- print "SSH connection established to %s" % host
- # Use invoke_shell to establish an 'interactive session'
- remote_conn = remote_conn_pre.invoke_shell()
- # Send some commands and get the output
- def abc(username, password, host, a, b, c, d, e)
- def xyz(username, password, host, a, b):
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement