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

Author Message
Stick32
[View user's profile]

Joined: 2014-11-17
Posts: 4
Location: MS
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:
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.
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Please attach a full session log file both from GUI and .NET assembly.
_________________
Martin Prikryl
Stick32
[View user's profile]

Joined: 2014-11-17
Posts: 4
Location: MS
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?
SessLog.txt (4.57 KB) [Download]

Description: Session Log

DebugLog.txt (37.7 KB) [Download]

Description: Debug Log

martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Yes, but I also need the successful log from GUI.
See https://winscp.net/eng/docs/ui_pref_logging
Stick32
[View user's profile]

Joined: 2014-11-17
Posts: 4
Location: MS
you mean this?
C--temp.log (20.26 KB) [Download]

Description: (none)

martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
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?
Stick32
[View user's profile]

Joined: 2014-11-17
Posts: 4
Location: MS
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. Embarassed it's working now.
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License