VanDyke Software Forums

VanDyke Software Forums (
-   Scripting (
-   -   Connect to a host through a jump server (

notorius7 04-14-2021 04:51 AM

Connect to a host through a jump server
Hello guys!

I am new here and from one week ago, I'm working with SecureCRT and I have encountered some issues. I do not know to write code and I need to do some things like:

I have this script: ( It run very well until a jump server appeared. I can use only SSH connection. How can I do to connect to jump server and then to run this script? What to add in the code?

SecureCRT: Version 8.7.2
OS: Win 10.

Thank you!

bgagnon 04-14-2021 08:35 AM

Hi notorius7,

I am glad to hear you found the one example script.

There is one here for jump host scenario as well.

Does that work for you?

notorius7 04-15-2021 01:41 AM

Thanks a lot for replying me!

I didn't try, but I thought that I can add in the script that I have another function that connect firstly to jump server via SSH and then to execute the commands, what do you think?

bgagnon 04-15-2021 07:37 AM

Hi notorious7,

As stated on the script examples sticky:


The examples here merely provide you with a starting point for creating your own scripting solutions.
Although a script example may appear to do "exactly what you need", the scripts listed here will almost
always need to be modified to meet your own specific needs.

You are welcome to make any changes you feel comfortable doing to any of the example scripts. :)

notorius7 04-27-2021 05:55 AM

I didn't succeed. I don't know how to change the code. Can someone help me with adding the code to connect to the jump host and then running the code from (

1. Connect to jump host
2. Inside jump host send ssh command to host
3. Connect to host
4. Send commands to host
5. Get log for host
6. Exit from host
7. Do the same for another n hosts
8. Exit from jump host

bgagnon 04-28-2021 11:22 AM

Hi notorius7,

Do you have just one jump host?

Is your jump host capable of port forwarding?

If so, have you tried using dependent session?

That way if you create the firewall session in SecureCRT, you could then just edit the firewall line in the script you wish to use.

The syntax to use a dependent session as a firewall would be:
g_strFirewall = " /FIREWALL=Session:<Session Name>"

notorius7 05-06-2021 05:54 AM


Yes, there is only one jump host which is not capable of port forwarding.
I read about firewall session, but the problem is that there are too many hosts and it is almost impossible to create all of the session with a firewall.

bgagnon 05-06-2021 07:38 AM

Hi notorius7,

You would not be saving sessions to the "end target", only the jumphost session. The hosts file would be the source for the end target connections. But if the jumphost does not support port forwarding, you cannot use dependent session. :)

Merging those two scripts would be too huge an undertaking right now. If we should ever come up with an example script we think will help you, we will post here.

All times are GMT -6. The time now is 10:31 PM.