Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Notices

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 07-26-2016, 10:57 AM
jdev's Avatar
jdev jdev is offline
VanDyke Technical Support
 
Join Date: Nov 2003
Location: Albuquerque, NM
Posts: 1,099
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.



--Jake
__________________
Jake Devenport
VanDyke Software
Technical Support
YouTube Channel: https://www.youtube.com/vandykesoftware
Email: support@vandyke.com
Web: https://www.vandyke.com/support

Last edited by jdev; 02-04-2019 at 01:18 PM. Reason: Update python example code
 

Tags
example script

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 04:36 AM.