EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Error - Invalid public key error

Also by EldoS: MsgConnect
Cross-platform protocol-independent communication framework for building peer-to-peer and client-server applications and middleware components.
#8926
Posted: 02/17/2009 04:02:09
by Robert Bruce (Basic support level)
Joined: 02/04/2009
Posts: 21

You say that Authentication type 16 is 'Keyboard-interactive authentication type has failed' but that doesn't make sense as on my server app in the user settings I haven't got 'Allow keyboard-interactive authentication' setting ticked at the moment which I've re-checked again this morning but I'm still getting

Authentication type[16] failed
Authentication Succeeded

I don't seem to be able to get past this problem at the moment?

And regarding the password you told me to set surely if I've only have the 'Allow public-key authentication' I don't need the password?

Rob

#8927
Posted: 02/17/2009 04:22:48
by Ken Ivanov (EldoS Corp.)

As the client does try keyboard-interactive authentication, the server obviously ignores the fact that the corresponding checkbox is turned off in its settings. According to SSH protocol, the client cannot initiate the authentication of particular type unless this type is supported and explicitly proposed by the server.

Quote
I don't seem to be able to get past this problem at the moment?

It's not a problem actually -- you may freely ignore this log message. You can turn off the corresponding authentication type on client side (by setting the AuthenticationTypes[SSH_AUTH_TYPE_KEYBOARD] to false) as well.

Quote
And regarding the password you told me to set surely if I've only have the 'Allow public-key authentication' I don't need the password?

Yes (if "Allow password authentication" checkbox is turned off).
#8931
Posted: 02/17/2009 06:00:51
by Robert Bruce (Basic support level)
Joined: 02/04/2009
Posts: 21

Many thanks for all your help. One more question I'm not sure how I'm supposed to set AuthenticationTypes to a false when it only accepts integer values?

In the code it set's it like this

SftpClient.AuthenticationTypes := SftpClient.AuthenticationTypes and not SSH_AUTH_TYPE_PUBLICKEY;

So what should I set it to turn off the corresponding authentication type?
#8932
Posted: 02/17/2009 10:02:27
by Ken Ivanov (EldoS Corp.)

The below code
Quote
SftpClient.AuthenticationTypes := SftpClient.AuthenticationTypes and not SSH_AUTH_TYPE_PUBLICKEY;

turns off public key authentication type. Use the same syntax to disable the keyboard-interactive authentication:
Code
SftpClient.AuthenticationTypes := SftpClient.AuthenticationTypes and not SSH_AUTH_TYPE_KEYBOARD;

#8944
Posted: 02/18/2009 03:58:10
by Robert Bruce (Basic support level)
Joined: 02/04/2009
Posts: 21

I've done that but I'm getting the following errors?

Authentication Type[2] failed
Authentication Type[4] failed
Error 114
#8945
Posted: 02/18/2009 04:16:04
by Ken Ivanov (EldoS Corp.)

Type [2] stands for SSH_AUTH_TYPE_PUBLICKEY and type [4] stands for SSH_AUTH_TYPE_PASSWORD. As you do not intend to authenticate with password, you may freely turn the SSH_AUTH_TYPE_PASSWORD flag off as well as SSH_AUTH_TYPE_KEYBOARD one.

A common reason for failure of public key authentication is wrong private key specified on client side (or wrong password for it).
#8946
Posted: 02/18/2009 04:35:31
by Robert Bruce (Basic support level)
Joined: 02/04/2009
Posts: 21

I'm nearly there, I'm only getting the error 114 at the moment?

OK on the client side I've set password to "password" as previously specified in an earlier message and I've set the 'Private key file for PUBLICKEY authentication type' to 'C:\Program Files\EldoS\SecureBlackbox\SSHKeys\private.ietf'.
#8947
Posted: 02/18/2009 05:21:23
by Ken Ivanov (EldoS Corp.)

Some SSH and SFTP client samples expect the private key to be passed in unencrypted form. Please open the source code of the sample and replace the code

Key.LoadPrivateKey(frmConnProps.edPrivateKey.Text)

with

Key.LoadPrivateKey(frmConnProps.edPrivateKey.Text, frmConnProps.editPassword.Text)

The exact names of the controls (e.g., "edPrivateKey") may differ for different samples, but I am sure you got the idea.
#8948
Posted: 02/18/2009 05:52:52
by Robert Bruce (Basic support level)
Joined: 02/04/2009
Posts: 21

OK I've done that and it works except that I've got this one back:

Authentication type[16] failed

despite having the following code set?

SftpClient.AuthenticationTypes := SftpClient.AuthenticationTypes and not SSH_AUTH_TYPE_PUBLICKEY;

SftpClient.AuthenticationTypes := SftpClient.AuthenticationTypes and not SSH_AUTH_TYPE_PASSWORD;

SftpClient.AuthenticationTypes := SftpClient.AuthenticationTypes and not SSH_AUTH_TYPE_KEYBOARD;

#8949
Posted: 02/18/2009 06:05:38
by Ken Ivanov (EldoS Corp.)

1) This
Quote
SftpClient.AuthenticationTypes := SftpClient.AuthenticationTypes and not SSH_AUTH_TYPE_PUBLICKEY;

is incorrect, as you are trying to set up public key authentication.

2) Please check that keyboard-interactive authentication type is not being enabled somewhere else in the code.
Also by EldoS: CallbackRegistry
A component to monitor and control Windows registry access and create virtual registry keys.

Reply

Statistics

Topic viewed 11558 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!