Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

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.
martin

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

you mean this?
Stick32

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?
martin

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

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

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.