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
(VB.NET UWP/WinRT) 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 New Chilkat.Ssh ' To get the authentication methods offered by an SSH server, we first connect. Dim success As Boolean = Await ssh.ConnectAsync("example.com",22) If (success <> True) Then Debug.WriteLine(ssh.LastErrorText) Exit Sub End If ' Next, we call GetAuthMethods to receive a comma separated list of authentication methods Dim authMethods As String = Await ssh.GetAuthMethodsAsync() If (ssh.LastMethodSuccess <> True) Then Debug.WriteLine(ssh.LastErrorText) Exit Sub End If ' For example: publickey,password,keyboard-interactive Debug.WriteLine("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.. Dim success As Boolean = Await ssh.ConnectAsync("example.com",22) If (success <> True) Then Debug.WriteLine(ssh.LastErrorText) Exit Sub End If success = Await ssh.AuthenticatePwAsync("myLogin","myPassword") If (success <> True) Then Debug.WriteLine(ssh.LastErrorText) Exit Sub End If Debug.WriteLine("SSH Authentication successful.") ' ... ssh.Disconnect() |
© 2000-2022 Chilkat Software, Inc. All Rights Reserved.