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 02-04-2013, 12:39 PM
PRZ PRZ is offline
Registered User
 
Join Date: Jan 2013
Posts: 4
Suppress SSH password prompts when scripted login fails

Hi

When creating an SSH2 session using the crt.Session.ConnectInTab method with a user name/password combination that gets rejected by the target device, I am presented with a "Password authentication failed" popup and then the "enter password" prompt, all of which is raining pretty hard on my automation parade. I would really like to suppress all popups, log that connection failed and move on. My connection attempt looks roughly as follows (nothing fancy):
Code:
On Error Resume Next
Set objSessionTab = crt.Session.ConnectInTab("/SSH2 /ACCEPTHOSTKEYS /L " & userid & " /PASSWORD " & password & " " & TargetNameOrIP, True, False)
If (Err.Number <> 0) Then
   'error handling
   Err.Clear
End If
A secondary nuiseance is that the Err.Number is the same whether the password was rejected (and all the prompts have been manually closed) or the device was unreachable/connection attempt timed out, but I can live with this if the prompts could be made to disappear...

Any pointers/suggestion/help is appreciated.
Reply With Quote
 

Tags
connect , login , 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 12:13 PM.