VanDyke Software Forums

VanDyke Software Forums (https://forums.vandyke.com/index.php)
-   Scripting (https://forums.vandyke.com/forumdisplay.php?f=14)
-   -   Example: Jump Host - Handle Secondary Host Connection Attempts (https://forums.vandyke.com/showthread.php?t=12416)

jdev 07-26-2016 10:57 AM

Example: Jump Host - Handle Secondary Host Connection Attempts
 
3 Attachment(s)
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.

https://forums.vandyke.com/attachmen...achmentid=1500

--Jake


All times are GMT -6. The time now is 12:24 PM.