Example: Jump Host - Handle Secondary Host Connection Attempts
Update 04 Feb, 2019 - The Python script example code has been updated. Example now shows how to handle authentications with multiple passwords (in case you have a variety of hosts with different passwords, or some hosts with an old password that has not yet been updated on some hosts).
This example script shows a way to handle secondary connection attempts when driving the remote shell of a primary connection to initiate a connection from a jump host to another host behind it. The key is to use crt.Screen.WaitForStrings() to wait for all possible responses that one could expect to see when attempting to run an 'ssh 2ndaryHost_IP' or 'telnet 2ndaryHost_IP' command in the remote shell of a connection you already have established/opened in SecureCRT to a primary jump host.
These examples are not exhaustive. They are designed to give you an overview of what the process/approach looks like. There may very well be systems that produce different output, and you will most likely need to modify this code to accommodate those responses which are different than these examples specifically handle.
Though the included graphic is a reference to the Python example, the concepts are similar for VBScript (though VBScript makes the code somewhat easier because it supports a select/case statement). Both a Python example as well as a VBScript example are provided for download.
YouTube Channel: https://www.youtube.com/vandykesoftware
Last edited by jdev; 02-04-2019 at 02:18 PM. Reason: Update python example code
|Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)|
|Display Modes||Rate This Thread|