Authentication failed with SFTP

Advertisement

JeanG
Guest

Authentication failed with SFTP

Hello.
I have troubles when I try to connect with SFTP Protocol.
My computer is running on Windows 10.

Here's the message I get (translated from French)
Authentication failed!
WinSCP.SessionRemoteException: Unexpected log out. Result of the exit command on the server 0
Authentication log:
Using user name: "xxx"
Authentication with public key "xxx"

And this is what I have in the end of the log file:
. 2016-06-23 14:19:50.374 Reading key file "xxx"
! 2016-06-23 14:19:50.375 Using username "xxx".
. 2016-06-23 14:19:50.452 Offered public key
. 2016-06-23 14:19:50.530 Offer of public key accepted
! 2016-06-23 14:19:50.530 Authenticating with public key "xxx"
. 2016-06-23 14:19:50.530 Prompt (passphrase, "SSH key passphrase", <no instructions>, "Passphrase for key "xxx": ")
. 2016-06-23 14:19:50.530 Disconnected: Unable to authenticate

I have a "-" in the password, could it be the cause of the error?

Thanks for your help :)

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: Authentication failed with SFTP

No the "-" should not be a problem.
Are you able to connect with any other SSH or SFTP client using this private key?

Reply with quote

JeanG
Guest

I can connect with FileZilla and WinSCP, but not with a SFTP client.

Here is a part the VB code of my client:

Dim sessionOptions As New SessionOptions
With sessionOptions
.Protocol = Protocol.Sftp
.HostName = "xxx"
.UserName = "xxx"
.Password = "xxx"
.SshHostKeyFingerprint = "xxx"
.SshPrivateKeyPath = "C:\xxx\PrivateKey.ppk"
.AddRawSettings("AuthKI", "0")
End With

Using session As New Session
session.SessionLogPath = "C:\xxx\logwinscp.txt"
' Connect
session.Open(sessionOptions)
End Using

Reply with quote

martin
Site Admin
martin avatar

Show us a log file from FileZilla.

What does it mean "I can connect with ... WinSCP, but not with a SFTP client"?

Reply with quote

JeanG
Guest

Sorry if I wasn't very clear.
I could connect with FileZilla and a SFTP Client Like WinSCP software, but I could't do it with my code.
I took the one generated by WinSCP software.

I found my mistake finally, in this code I didn't need the password but the PrivateKeyPassphrase. I mingled theses 2.

Thanks for help :)

Reply with quote

Advertisement

You can post new topics in this forum