Key authentication (General questions)
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:
- Key authentication - BrianG, 2019-03-25, 15:22
- Key authentication - Jasmine, 2019-03-25, 15:30
- Key authentication - BrianG, 2019-03-26, 13:56
- Key authentication - Jasmine, 2019-03-26, 14:58
- Key authentication - BrianG, 2019-03-26, 13:56
- Key authentication - Jasmine, 2019-03-25, 15:30