Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 10-09-2018, 02:52 AM
shea_nb shea_nb is offline
Registered User
 
Join Date: Oct 2018
Posts: 2
Scripting Multiple Sessions Through a Jumpbox

I am very new to scripting in SecureCRT and am currently editing a .bat file for connecting to multiple devices at once. It requires a plain text login and password which I desperately need to get away from. This is currently the format of the .bat file which the hostnames are edited a few times a night to connect to the specific devices. This will open each device in a seperate tab and allow me to run various other .vbs files or just type out commands.


cd \Program Files\VanDyke Software\Clients

SecureCRT /T /SSH2 /ACCEPTHOSTKEYS /PASSWORD XXXXXXXX /L user hostname1
SecureCRT /T /SSH2 /ACCEPTHOSTKEYS /PASSWORD XXXXXXXX /L user hostname2
SecureCRT /T /SSH2 /ACCEPTHOSTKEYS /PASSWORD XXXXXXXX /L user hostname3
SecureCRT /T /SSH2 /ACCEPTHOSTKEYS /PASSWORD XXXXXXXX /L user hostname4
SecureCRT /T /SSH2 /ACCEPTHOSTKEYS /PASSWORD XXXXXXXX /L user hostname5
SecureCRT /T /SSH2 /ACCEPTHOSTKEYS /PASSWORD XXXXXXXX /L user hostname6
SecureCRT /T /SSH2 /ACCEPTHOSTKEYS /PASSWORD XXXXXXXX /L user hostname7
SecureCRT /T /SSH2 /ACCEPTHOSTKEYS /PASSWORD XXXXXXXX /L user hostname8
SecureCRT /T /SSH2 /ACCEPTHOSTKEYS /PASSWORD XXXXXXXX /L user hostname9
SecureCRT /T /SSH2 /ACCEPTHOSTKEYS /PASSWORD XXXXXXXX /L user hostname0


We have a jumpbox with a built in script for connecting to devices in the same manner and I am trying to figure out how to build a more efficient .bat or .vbs to perform this task.


cd \Program Files\VanDyke Software\Clients


SecureCRT /T /S "my_jumpbox"


Would be the example for connecting to the jumpbox. It also has a built in script for connecting to devices and because it uses an SSH Key no login or pass is needed in a plain text file. Below is the example output needed to connect to devices.

my_jumpbox$ ym hostname1

That will allow me to connect to the device from the jumpbox without the need to enter a login/pass. I am just hitting a wall on trying to get this scripted into a .bat or .vbs file or both so that I can get away from the aforementioned process of saving a pass in a plain text file. Whether anyone can just point me in the right direction or provide an example output for opening the jumpbox via multiple tabs at once with send strings would help. The goal is having only one file that would have to be edited with the hostnames which I could accomplish with replace strings or another formula.
Reply With Quote
 

Tags
jumpbox jump box , multiple at once , scripting


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:00 PM.