View Single Post
Old 05-03-2019, 10:03 AM
jdev's Avatar
jdev jdev is offline
VanDyke Technical Support
Join Date: Nov 2003
Location: Albuquerque, NM
Posts: 974
Dear vikram1840,

Please use [CODE] and [/CODE] tags around your script code so that indentation/formatting is not lost through HTML browser space aggregation; for example:
With respect to the code you're writing and the error that occurs, what is the exact wording of the error/failure message(s) that you see?

To display debugging/troubleshooting info for connection attempts, you can set Trace Level to 1 for such info to be displayed to the terminal window before you make the call to Connect().

Also, unless your user_name variable's value includes a trailing space character, you're ending up with the /PASSWORD component immediately concatenated to the end of your username, which could be a source of problems for you (see the first section of your code marked in red below). Imagine this working?
SecureCRT /SSH2 /L usernm/Password p4$$w0rd/neIdblahblahblah
No. That won't work... it will start the auth process as user "usernm/Password" and all the rest of the command line will be gibberish because SecureCRT can only then assume that p4$$w0rd/neIDblahblahblah is the host name.

In addition, I have to question... why are you limiting the connection to only being able to use the deprecated/old 3DES cipher and MD5 MAC? (see the second section of your code marked in red below). If you're connecting to any newer hosts, that cipher and/or MAC may not be supported. I'd suggest eliminating this from your code unless you somehow want to the connection to fail or use the weakest of all algorithms.

    crt.Session.LogFileName = log_file
    crt.Session.Log True

    ' Turn on Trace Options before attempting the connection
    ' so that troubleshooting/debugging info can be displayed
    ' to the terminal screen:
    crt.Session.Config.SetOption "Trace Level", 1

    cmd = "/SSH2 /P 8022 /L " & user_name & "/PASSWORD " & password & "/neId" & neId &  " /C 3DES /M MD5 " & Hostname 
    crt.Session.Connect cmd

    crt.Screen.send "amos ABCD" & vbCr

Attached Images
File Type: png Forum_Post_WrapCodeWith[CODE]Tags.png (46.7 KB, 298 views)
Jake Devenport
VanDyke Software
Technical Support
YouTube Channel:
Reply With Quote