View Single Post
  #7  
Old 07-16-2007, 11:10 AM
1720 1720 is offline
Registered User
 
Join Date: Jul 2007
Posts: 13
Hi Teresa,

The script is almost working except it is not accepting command line args. So here is what I am doing from cmd line -

securecrt /script .\scripts\ssh.vbs /arg test

I get the following error in a popup window -
Error: Object required: 'WScript'

Here is my updated script -
# $language = "VBScript"
# $interface = "1.0"

' Connect to an SSH server using the SSH2 protocol. Specify the
' username and password and hostname on the command line as well as
' some SSH2 protocol specific options.

Sub Main

Dim host
host = "10.20.4.205"

Dim user
user = "engineer"

Dim passwd
passwd = "mypasswd"

Dim device
device = WScript.Argument(0)

Dim user_name
user_name = crt.Dialog.Prompt("Enter your TACACS ID for ", user_name, "TACACS Login",False)

' Build a command-line string to pass to the Connect method.
cmd = "/SSH2 /L " & user & " /PASSWORD " & passwd & " /C 3DES /M MD5 " & host
crt.Session.Connect cmd

crt.Screen.Send "ssh -l " & user_name & " " & device & chr(13)
crt.Screen.WaitForString "Are you sure you want to continue connecting (yes/no)? "
crt.Screen.Send "yes" & chr(13)

End Sub
Reply With Quote