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 01-10-2013, 10:42 PM
Lukesh Lukesh is offline
Registered User
 
Join Date: Jan 2013
Posts: 1
Question Differentiating SSH Failure and Authentication Failure

Please suggest me how to differentiate the SSH failure and authendication failure on the below script.

ConnectionString = "/SSH2 /L " & strUsername & " /PASSWORD " & strPassword & " /AcceptHostKeys "& strCurrentHostname

crt.Session.Connect ConnectionString

On Error Resume Next.
Reply With Quote
  #2  
Old 01-11-2013, 10:01 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi Lukesh,

Thanks for the question. You can use the following code to determine what error is being returned:
Code:
    On Error Resume Next
        crt.Session.Connect strConnectInfo
        ' Capture the error code and description (if any)
        nError = Err.Number
        strErr = Err.Description
    ' Restore normal error handling so that any other errors in our
    ' script are not masked/ignored
    On Error Goto 0
Is this helpful?

What problem are you trying to solve?
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #3  
Old 01-11-2013, 01:08 PM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi Lukesh,

I was wrong. It is not possible to successfully determine authentication failure using On Error Resume Next with the Connect method, but it should work for connection failures.

It would be necessary to handle the authentication in the terminal window to capture what might be happening. You can find an example of how to do this in the following post:
http://forums.vandyke.com/showthread...7087#post37087
Does this help you accomplish your goal?
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
Reply

Tags
authendication , lukesh , ssh


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 01:27 PM.