Chilkat HOME Android™ Classic ASP C C++ C# Mono C# .NET Core C# C# UWP/WinRT DataFlex Delphi ActiveX Delphi DLL Visual FoxPro Java Lianja MFC Objective-C Perl PHP ActiveX PHP Extension PowerBuilder PowerShell PureBasic CkPython Chilkat2-Python Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ Visual Basic 6.0 VB.NET VB.NET UWP/WinRT VBScript Xojo Plugin Node.js Excel Go
(Excel) Get SSH Server Authentication MethodsDemonstrates how to get the authentication methods of an SSH server. This example requires Chilkat v9.5.0.78 or greater.
' This example requires the Chilkat API to have been previously unlocked. ' See Global Unlock Sample for sample code. Dim ssh As Chilkat.Ssh Set ssh = Chilkat.NewSsh ' To get the authentication methods offered by an SSH server, we first connect. success = ssh.Connect("example.com",22) If (success <> True) Then Debug.Print ssh.LastErrorText Exit Sub End If ' Next, we call GetAuthMethods to receive a comma separated list of authentication methods authMethods = ssh.GetAuthMethods() If (ssh.LastMethodSuccess <> True) Then Debug.Print ssh.LastErrorText Exit Sub End If ' For example: publickey,password,keyboard-interactive Debug.Print "Authentication methods suported by this serve: "; authMethods ' IMPORTANT: ' Getting the authentication methods will intentionally disconnect from the server. ' We'll need to re-connect, etc. to continue.. ' For example.. success = ssh.Connect("example.com",22) If (success <> True) Then Debug.Print ssh.LastErrorText Exit Sub End If success = ssh.AuthenticatePw("myLogin","myPassword") If (success <> True) Then Debug.Print ssh.LastErrorText Exit Sub End If Debug.Print "SSH Authentication successful." ' ... ssh.Disconnect |
© 2000-2022 Chilkat Software, Inc. All Rights Reserved.