Topic "Disconnected: No supported authentication methods available"

Author Message
pudgmo
[View user's profile]

Joined: 2015-03-18
Posts: 7
Location: Mn
Hi, I'm getting this error when connecting to XP machine. Would really like to accept the key and continue working. The full text of error is...
Disconnected: No supported authentication methods available (server sent: publickey, keyboard-interactive)
If I have to manually accept the key that would be OK but would really like to accept automatically.
Here's me code
With mySessionOptions
.AddRawSettings("AuthKI", "1")
.Timeout = New TimeSpan(0, 2, 0) '2 minutes
.Protocol = Protocol.Sftp
.HostName = sIP
.PortNumber = Val(sPort)
.UserName = sUser
.Password = sPassword
.GiveUpSecurityAndAcceptAnySshHostKey = True
End With
Using mysession As Session = New Session
mysession.Open(mySessionOptions)

It's failing on the open command. I've been playing with the .addrawsetting option (tried using hostkey instead of AuthKI with same result) . I've been able to connect to win7 machines with this code. Unfortunatly I still need to connect with XP machines for a time. This is on a company network and I'm really only concerned with what is being sent across the wire so I use .GiveUpSecurityAndAcceptAnySshHostKey = True.
Does anyone know how to accept the key automagically? using vb.net
Regards
Rob

Edit: Attached log
winscp.log (4.63 KB) [Download]

Description: (none)

Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24995
Location: Prague, Czechia
How does the authentication look in GUI? Can you see the "password" when typing it or do you see dots?

Please attach a full log file from a successful (if possible) authentication in GUI (using the latest version of WinSCP).

To generate log file, enable logging, log in to your server and do the operation and only the operation that causes the error. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.
_________________
Martin Prikryl
pudgmo
[View user's profile]

Joined: 2015-03-18
Posts: 7
Location: Mn
Thank you prikryl I have attached a log that worked (replaced sensitive info).
FYI: The program grabs user info from a db so there is no typing. This application could potentially hit thousands of servers which is the biggest reason I don't want to use key authentication.
Regards
winscp.log (7.01 KB) [Download]

Description: (none)

pudgmo
[View user's profile]

Joined: 2015-03-18
Posts: 7
Location: Mn
I tried connecting through gui to both the good and bad servers. Attached zip contains both logs.
S=success F=fail
Thanks
scplogs.zip (7.13 KB) Private file

Description: (none)

pudgmo
[View user's profile]

Joined: 2015-03-18
Posts: 7
Location: Mn
Hi Martin,
I'm still trying to work through this issue.
It seems the problem lies somwhere with my code.
I was able to connect through the GUI but am still getting the same message in my program.
I went into the ftpsite and made sure the user i connect with and my IP we specifically given access. This is the same server that was failing yesterday with the GUI. I've attached both logs in hopes you can point me twoard a solution.

Rob
winscp2.zip (8.77 KB) [Download]

Description: (none)

martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24995
Location: Prague, Czechia
pudgmo wrote:
FYI: The program grabs user info from a db so there is no typing.

I was asking about authentication in GUI.
pudgmo
[View user's profile]

Joined: 2015-03-18
Posts: 7
Location: Mn
It shows dots in the GUI.
pudgmo
[View user's profile]

Joined: 2015-03-18
Posts: 7
Location: Mn
As I've been working through this, the error message has changed.
It now say's 'Connection has been unexpectedly closed. Server sent command exit status 0.
It's saying that it failed the password check but I am able to log in with the same credentials,
In the program it never gets passed the open statement. The last lines of the log are...
* 2015-03-23 14:48:29.999 WARNING! Giving up security and accepting any key as configured!
. 2015-03-23 14:48:29.999 Host key fingerprint is:
. 2015-03-23 14:48:29.999 ssh-rsa 1024 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
. 2015-03-23 14:48:29.999 Initialised AES-256 SDCTR client->server encryption
. 2015-03-23 14:48:29.999 Initialised HMAC-SHA1 client->server MAC algorithm
. 2015-03-23 14:48:29.999 Initialised AES-256 SDCTR server->client encryption
. 2015-03-23 14:48:29.999 Initialised HMAC-SHA1 server->client MAC algorithm
! 2015-03-23 14:48:30.155 Using username "adminusername".
. 2015-03-23 14:48:30.155 Prompt (7, SSH password, , &Password: )
. 2015-03-23 14:48:30.155 Using stored password.
. 2015-03-23 14:48:30.155 Sent password
. 2015-03-23 14:48:30.155 Password authentication failed
! 2015-03-23 14:48:30.155 Access denied
. 2015-03-23 14:48:30.155 Prompt (7, SSH password, , &Password: )
. 2015-03-23 14:48:30.155 Disconnected: Unable to authenticate
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24995
Location: Prague, Czechia
After the change, can you login with GUI? The change may indicate that your account was locked out.
_________________
Martin Prikryl
pudgmo
[View user's profile]

Joined: 2015-03-18
Posts: 7
Location: Mn
Hi Martin, I finally got this resolved so I thought I would give you aan update.
All the machines that I am connecting to use remotelyanywhere to manage sftp. I saw a few different versions that didn't work but upgrading to v 11 has them all working!
Here's the code I'm using...
With mySessionOptions
.AddRawSettings("AuthKI", "0")
.Timeout = New TimeSpan(0, 1, 30)
.Protocol = Protocol.Sftp
.HostName = sIP
.PortNumber = Val(sPort)
.UserName = sUser
.Password = sPassword
.GiveUpSecurityAndAcceptAnySshHostKey = True
End With

Regards
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24995
Location: Prague, Czechia
Thanks for sharing your solution.

Also make sure you understand that you are loosing any security by setting GiveUpSecurityAndAcceptAnySshHostKey = True.
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