VanDyke Software

Scripting Examples


Jump Host — Handle Secondary Host Connection Attempts

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 what 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.

Note that the Python example 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).

Jump Host Python Example

Example Scripts (8.8 KB)
JumpHost-HandleSecondaryHostConnectionAttempts.vbs.txt (6.8 KB)


VanDyke Software uses cookies to give you the best online experience. Before continuing to use this site, please confirm that you agree to our use of cookies. Please see our Cookie Usage for details.