Key authentication - WeOnlyDo Discussion board

Key authentication (General questions)

by BrianG, Tuesday, March 26, 2019, 13:56 (1855 days ago) @ Jasmine

Thanks Jasmine,

I discovered I hadn't loaded the WeOnlyDo.Security reference, newbie mistake!

So in order to first create the key pair, I do something like this:

key.Generate(WeOnlyDo.Security.Cryptography.SSHKeyTypes.RSAKey, 1024)
key.Save(KeyDir & "\WODkey.pri", "password")
Dim PubKey As String = key.PublicKeyOpenSSH(WeOnlyDo.Security.Cryptography.SSHKeyTypes.RSAKey)
My.Computer.FileSystem.WriteAllText(KeyDir & "\WODkey.pub", PubKey, False)

Once I've run that and it has created both the private and public key files, I'm done with that code, correct? Then I send the public key file to the server, where it is set as the key file for my userid. Then in order to connect, I just need to Load the private key and set the PrivateKey property to it as in your example below?

Assuming that is all correct, I am getting an "Authentication with the server failed." error and my server log reports a "key-check failure", can you shed any light on that?

Thanks again,

Brian


Complete thread: