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.
#8851
Posted: 02/11/2009 09:43:09
by Robert Bruce (Basic support level)
Joined: 02/04/2009
Posts: 21

I've just copied the following into the set public key part of the SFTP Server sample app and it produces this error.

30 81 89 02 81 80 59 ed 19 5b 92 9c 43 d8 3a dc 61 60 81 93 bc 55 00 72 5c e0 f3 3a 3e cd 06 2a 8c 4c dc c5 bf b7 9c f8 64 4d 62 79 56 d9 88 3d 16 f3 a4 49 84 d8 57 cc ea e6 c2 1f 7f 1c b4 c8 c3 4d 20 69 66 63 4e eb 67 6e 47 02 cb a4 1e 14 64 c0 30 7f 42 4a f9 24 0e 6b 8c 10 c5 4d c6 a8 7c 41 af c6 79 86 d7 c7 d9 fa b3 a9 00 61 df 40 26 71 6a bf 3b e9 db 92 d9 f1 4a 20 77 87 18 48 3d af 45 5c 59 51 02 04 00 01 00 01

Please can you tell me how to copy the binary version of this hex to the clipboard so that I can then paste into Set public key box?

Rob
#8853
Posted: 02/11/2009 10:04:19
by Ken Ivanov (EldoS Corp.)

SFTP server expects the key to be in PEM-enveloped format. Besides, you have to use the *private* key (not the public one).
#8870
Posted: 02/12/2009 09:46:29
by Robert Bruce (Basic support level)
Joined: 02/04/2009
Posts: 21

I'm still very confused despite doing some more reading! If I need to use a private key why does it ask me for the public one? Please can you give me a sample of a private key that I can paste into the sample app?

I've noticed that a private key already exists in the server settings, your not confusing what private key you think I'm talking about?
#8875
Posted: 02/12/2009 11:02:50
by Eugene Mayevski (EldoS Corp.)

Let's start from the beginning - are you asking about a server key or keys for clients? Server key must be a private one, while client keys are obviously public. But still they must be in PEM format, not the one you used.

We have sample SSH keys in \SSHKeys directory and you can generate your own keys using KeyDemo sample in \Samples\..\SSHBlackbox.


Sincerely yours
Eugene Mayevski
#8891
Posted: 02/13/2009 06:38:53
by Robert Bruce (Basic support level)
Joined: 02/04/2009
Posts: 21

We have sample SSH keys in \SSHKeys directory and you can generate your own keys using KeyDemo sample in \Samples\..\SSHBlackbox.

OK thanks for pointing that out the Key Demo Sample as I hadn’t seen this before and its been very useful.

I’ve noticed that there are ‘server settings’ which already has a private key set up and I was wondering whether you thought I was talking about these and not the ‘user setting’ form that you can use to add/set up each user?

Now if try and copy the private key from the SSH Key Sample and post it just keeps saying ‘Error – invalid public key’. But if I copy and then paste in the public key it’s accepted. So I’m certain that it’s not possible to add a private key here!?

Finally using the SSH Key sample I was able to create/save the private key as a .PEN file. Then I opened up the Simple SFTP Client Demo App and updated the connection properties and where is says ‘Private key file for PUBLICKEY authentication type’ I set this to the directory and file name to the .PEN file that I’d just created, and tried to reconnect. Unfortunately, I’d failed to connect with the following error code 10060?

I think I’m definitely making progress but something appears not to be correct?

Note: that I’ve previously managed to connect with the username and password setting without any problems.

#8893
Posted: 02/13/2009 07:38:07
by Ken Ivanov (EldoS Corp.)

If you need to set up a user's key, then of course it should be a public one. Sorry for misunderstanding.

Please try to do the following:
a) assign the contents of the public.ietf file (from the SSHKeys directory) to the user account which you need to authenticate with a key,
b) specify the private.ietf file (along with the "password" password) in SimpleSFTPDemo sample.
#8898
Posted: 02/13/2009 10:22:27
by Robert Bruce (Basic support level)
Joined: 02/04/2009
Posts: 21

OK I've done what you suggested and I'm a bit confused as I seem to get 2 conflicting messages:

Authentication type[16] failed

Followed by

Authentication Succeeded

???
#8899
Posted: 02/13/2009 10:43:51
by Robert Bruce (Basic support level)
Joined: 02/04/2009
Posts: 21

And another thing should I set the Password to 'password' in both the Server and Client apps?
#8900
Posted: 02/13/2009 10:44:53
by Ken Ivanov (EldoS Corp.)

Quote
Authentication type[16] failed
Authentication Succeeded

In English it sounds like: "Keyboard-interactive authentication type has failed. Let's try another authentication type, with a public key. Great! The server has accepted our public key, so we can start information exchange.".

Keyboard-interactive authentication is similar to password-based authentication. As you do not provide a valid password, it fails. However, the subsequent public key authentication succeeds.
#8902
Posted: 02/13/2009 10:48:26
by Ken Ivanov (EldoS Corp.)

Quote
And another thing should I set the Password to 'password' in both the Server and Client app

Which exactly password are you talking about?

Key password is needed only to decrypt a private key (which is stored in encrypted form). Public key is stored in plaintext, so the passphrase is not needed for it.
Also by EldoS: CallbackRegistry
A component to monitor and control Windows registry access and create virtual registry keys.

Reply

Statistics

Topic viewed 11560 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!