Welcome to the VanDyke Software Forums

Join the discussion today!

Go Back   VanDyke Software Forums > Scripting

Thread Tools Rate Thread Display Modes
Old 04-24-2019, 05:07 AM
n.milovancevic n.milovancevic is offline
Registered User
Join Date: Apr 2019
Posts: 1
script for automatic login to the host defined in Name

Hi all,
is there a way to create vbs script which would ssh to jump server and from there ssh to the host defined in Connection --> Name field. I cannot find such a variable. The idea is to have one script for connecting different hosts over jump server ... any suggestions?
Reply With Quote
Old 04-24-2019, 08:40 AM
bgagnon bgagnon is offline
VanDyke Technical Support
Join Date: Oct 2008
Posts: 4,439
Hello n.milovancevic,

What version of SecureCRT is installed?

If your jump host is capable of port forwarding, I would think this method of going through a jump host would be simpler:

Changes in SecureCRT 7.1 (Beta 1) -- February 26, 2013
New features:

  • Added support for dependent sessions so that a connection can be made to a jump host or SSH gateway before the session is connected.

See this YouTube video about using Dependent Session to connect via a jump host.

If you would rather not use dependent session, it's probably a simple enough script as you would just be sending a command once you authenticate successfully to the jump host.

You can use the Path property available to the Session Object to get the session name (but then you would need to parse out any extraneous info if this session happens to be nested inside folders). Then it would be a simple matter of using Send() to run the command once verifying you were at the shell of the jump host:

strPathVar = "parsed result from crt.Session.Path"
crt.Screen.WaitForString "MyJumpHostPrompt"
crt.Screen.Send "ssh " & strPathVar

See the Scripting / Script Objects Reference topic in SecureCRT's Help file for more info.

VanDyke Software
Technical Support
(505) 332-5730
Reply With Quote

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
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 03:49 PM.