Error: "Disconnected: No supported authentication methods"

Advertisement

Stick32
Joined:
Posts:
4
Location:
MS

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:
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
Every time the code throws an exception when I try to open the session.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,441
Location:
Prague, Czechia

Re: Error: "Disconnected: No supported authentication methods"

Please attach a full session log file both from GUI and .NET assembly.

Reply with quote

Stick32
Joined:
Posts:
4
Location:
MS

Log files

Are these the log files your looking for? Judging from the logs it's actually failing at keyboard authentication? Is there a way to get around that?
Description: Session Log
Description: Debug Log

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,441
Location:
Prague, Czechia

Thanks. I did not find any difference. Do you have any special character in your password that may got wrongly encoded by the .NET assembly?
Try to upgrade to 5.6.3 beta and add mySess.AddRawConfiguration("LogSensitive", "1").
It will make the log file include password. Please verify that the logged password is indeed the one you want to use.
Also, did you check a server-side log?

Reply with quote

Stick32

Ok after spending so much time looking at the password and ssh key I realized that one of the characters in the user name was wrong. :oops: it's working now.

Reply with quote

Advertisement

You can post new topics in this forum