Error: "Disconnected: No supported authentication methods"
I'm having trouble opening a session from .Net. I can run script job with all the same connection info but when I try to do it using the .Net assmbly I get a RemoteSessionException with the error message "Disconnected: No supported authentication methods available (server sent: )" My code is basically the same as the example code yet it fails every time.
Am I doing something wrong here below is my code:
Every time the code throws an exception when I try to open the session.
Am I doing something wrong here below is my code:
Dim sessOpt As New SessionOptions
With sessOpt
.Protocol = Protocol.Sftp
.HostName = "blah.blah.gov"
.UserName = user
.Password = pass
.PortNumber = 22
.SshHostKeyFingerprint = sshkey
End With
Console.WriteLine("Initializing session...")
Using mySess As Session = New Session
mySess.ExecutablePath = "C:\Program Files (x86)\WinSCP\WinSCP.exe"
mySess.IniFilePath = "C:\temp\Tagdata\WinSCP.ini"
mySess.Open(sessOpt)
Dim transfOpt As New TransferOptions
transfOpt.TransferMode = TransferMode.Binary
Console.WriteLine("Session Initialized. Beginning Download...")
'Dim trnsResult As TransferOperationResult
mySess.GetFiles("/root/production/*", My.Settings.InputFile, False, transfOpt).Check()
Console.WriteLine("Download complete. Closing session...")
End Using