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

martin

Re: Resolved

Thanks for sharing your solution.

Also make sure you understand that you are loosing any security by setting GiveUpSecurityAndAcceptAnySshHostKey = True.
pudgmo

Resolved

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

Re: I should update message

After the change, can you login with GUI? The change may indicate that your account was locked out.
pudgmo

I should update message

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
pudgmo

It shows dots in the GUI.
martin

Re: Disconnected: No supported authentication methods available

pudgmo wrote:

FYI: The program grabs user info from a db so there is no typing.

I was asking about authentication in GUI.
pudgmo

slight success

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
pudgmo

hello again

I tried connecting through gui to both the good and bad servers. Attached zip contains both logs.
S=success F=fail
Thanks
pudgmo

Disconnected: No supported authentication methods available

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
martin

Re: Disconnected: No supported authentication methods available

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

Disconnected: No supported authentication methods available

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