Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 05-30-2006, 05:33 AM
koffkoffus koffkoffus is offline
Registered User
 
Join Date: Mar 2006
Posts: 1
Script to connect to saved SSH sessions / configs?

Hello VanDyke,

Every morning when I arrive at work I connect to about 17 different hosts. All of these hosts are servers I have to monitor for my company.

As it is now, I manually type
1) Alt-F / C
2) Navigate to the target session config (ex mail9.example.edu),
3) type <enter>, then repeat the process for the other 16 target hosts.

I've done quite a bit of vbscripting for VBA / cscript, however the help file(s) didn't 'show me the light' on how to get a SecureCRT script to automate all these connections. Can someone provide an example for this kind of thing?

Second question... are there any plans to offer SecureCRT for Linux? I'm down to 1 Windows machine now and would like to have SecureCRT available for my 4 other Linux workstations.

Thanks for any help on pointers to get this script rolling - I'd like to save those 5 minutes every morning for something more productive.

Koff
Reply With Quote
  #2  
Old 05-30-2006, 08:37 AM
tnygren's Avatar
tnygren tnygren is offline
Registered User
 
Join Date: May 2005
Posts: 1,408
Hello Koff,

There are a couple of methods to automatically open all these sessions.

These can be done either from a script or just a shortcut on the desktop.

Did you want all these sessions to open in tabs or windows?

If it is in tabs, the easiest method is a shortcut on the desktop.

Just create a shortcut to SecureCRT.exe (or make a copy of the default one on the desktop), and modify the end of the target line to look like the following:

SecureCRT.exe /S session1 /S session2 /S session3

This command will automatically start these 3 sessions in tabs.

This command line can also be used in a script to start SecureCRT.

If individual windows are preferred, this is easiest in a script with the following lines:

crt.session.Connect("/s Session1")
crt.session.Connect("/s Session2")
crt.session.Connect("/s Session3")

As for a version for Linux, this is something that has been requested before.

I have added this forum thread to that request so a post can be made here if a version of SecureCRT is released for Linux.

If you would prefer to be contacted via email, please send a message to support@vandyke.com with a subject of ATTN: Teresa Forum Thread 1163.
__________________
Thanks,

Teresa

Teresa Nygren
Reply With Quote
  #3  
Old 06-27-2006, 11:27 AM
kaj2 kaj2 is offline
Registered User
 
Join Date: Jun 2006
Posts: 4
This works for me, but I'm also interested in being able to do the following:

- invoke a script
- have the script prompt for a password
- connect to a list of servers using that password
- have each connection open within a tab

I've been able to prompt and logon, but I can't figure out how to do more than 1 connection (i.e. the tab part).

thanks,
Ken
Reply With Quote
  #4  
Old 06-27-2006, 12:56 PM
tnygren's Avatar
tnygren tnygren is offline
Registered User
 
Join Date: May 2005
Posts: 1,408
Hi Ken,

Currently, there isn't an option to open a tab in an existing SecureCRT window.

This is something that we also have had several requests to add to a future release of SecureCRT.

I've added this post to that request.

If you would prefer to be contacted via email, just send me a message using the same information from my previous post.

Did you also need to be able to control that tab from a script once it is opened?
__________________
Thanks,

Teresa

Teresa Nygren
Reply With Quote
  #5  
Old 06-29-2006, 06:53 PM
kaj2 kaj2 is offline
Registered User
 
Join Date: Jun 2006
Posts: 4
I guess controlling after logon is not much of an issue for me. I would just like to have a process that prompts me for my password (which changes periodically) and then uses that password to logon to a set of hosts.

I created a shortcut to start SecureCTR with a series of /S hostx parameters. However, I then have to enter my password for each host. I don't want to imbed the password in the session object.

I could setup ssh so that I have keys on each host that allow me to logon without a password. However, I don't really want to do that.

Any ideas would be appreciated.

thanks,
Ken
Reply With Quote
  #6  
Old 06-30-2006, 08:38 AM
tnygren's Avatar
tnygren tnygren is offline
Registered User
 
Join Date: May 2005
Posts: 1,408
Hi Kaj2,

We have added the option to open a tab in an existing session to SecureCRT.

This is available in a pre-beta version of SecureCRT 5.2.

Would you like to try this build?

Using this option would allow you to connect to each session individually. It would be possible in a script to prompt for the password you need to use and pass that previously entered password to each of the sessions via the command line.

Would this help?

If so, please send an email to support@vandyke.com with the subject of ATTN: Teresa Forum Thread 1463.
__________________
Thanks,

Teresa

Teresa Nygren
Reply With Quote
  #7  
Old 07-20-2006, 01:35 AM
kaj2 kaj2 is offline
Registered User
 
Join Date: Jun 2006
Posts: 4
Trying to use /T option in pre-beta

Hi,

I tried this script:

# $language = "VBScript"
# $interface = "1.0"


Sub Main

Dim host
host = "ods01"
Dim uid
Dim pass
uid = crt.Dialog.Prompt("Enter your userid:","User id", "", False)
pass = crt.Dialog.Prompt("Enter your password:", "Password", "", True)

' Build a command-line string to pass to the Connect method.
'
cmd = "/T /S " & host & " /L " & uid & " /PASSWORD " & pass

crt.Session.Connect cmd

End Sub

It works fine the first time, connecting in a tab with a name of ods01. The 'ods01' session is created with no userid and all default settings. When I modify the script to a 2nd host name, I get the error box message:

Error: Connect: already connected.

I'm using the version 5.2.0 (build 156) - Internal Build Jun 27 2006

thanks,
Ken
Reply With Quote
  #8  
Old 07-24-2006, 05:04 PM
Maureen's Avatar
Maureen Maureen is offline
VanDyke Product Director
 
Join Date: Feb 2004
Location: Albuquerque, NM
Posts: 1,612
We have recently added support for tabs in scripting to SecureCRT 5.2, which is in pre-beta testing. I will send you a new installer with this functionality. If anyone else is interested in trying it, please send e-mail to me at Maureen.Jett@vandyke.com.

Maureen
Reply With Quote
  #9  
Old 03-17-2011, 04:12 PM
Maureen's Avatar
Maureen Maureen is offline
VanDyke Product Director
 
Join Date: Feb 2004
Location: Albuquerque, NM
Posts: 1,612
Quote:
Originally Posted by koffkoffus
Hello VanDyke,

<snip>

Second question... are there any plans to offer SecureCRT for Linux? I'm down to 1 Windows machine now and would like to have SecureCRT available for my 4 other Linux workstations.
A beta of SecureCRT for Linux was released last week. Currently, Ubuntu 10.x and Red Hat Enterprise Linux 5.5 are supported. If you'd like to try it, you can download it from the following web page.

http://www.vandyke.com/download/securecrt/beta.html

Maureen
Reply With Quote
Reply


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:21 AM.