Re: SSH2 and key files (General questions)
Chris,
let me try to answer your questions:
1. Does the key I generate first need to be loaded on the server I will connect? I believe I read this somewhere.
When you generate your own private key, you need to extract it's public key part (you can do that using wodKeyManager's PublicKeySSH and PublicKeyOpenSSH properties), and paste them to appropriate file on the server. That makes sure that only you have corresponding private key for public key you pasted. If this step wouldn't exist, then basically anyone who generates his key would be able to connect.
2. I have f-secure client installed and am able to connect with it. I tried loading the key file from it but get an error that it cannot be loaded. I am not sure what file to use from f-secure. I have 2 key files with my id, one has no extension(private key), the other has .pub extension(public key), but there are also public keys from the server. which key file is the one i would load?
Unfortunatelly, we cannot reuse F-Secure keys, you must generate new ones. So, generate it, get public part, and paste it on the same place on the server where you did it last time for your existing key. I think F-Secure helpfile will tell you where exactly to paste it.
3. Do I need to generate the file everytime I connect or can I just keep reusing the one previously generated?
No, do this only once, and then load it from the file. If you would regenerate new key, then you would have to paste public key to the server each time. Once you paste one public key, use only corresponding private key each time you connect.
Currently the code fails when trying to load the file...
km.Save(SSHKeyTypes.DSAKey, d:\temp.dsa , password )
km.Load(km.PublicKeyOpenSSH(WeOnlyDo.Security.Cryptography.SSHKeyTypes.DSAKey), password )
Set first parameter in Load method to key name, iow set it to d:\temp.dsa and it should work.
Let me know how it goes.
Complete thread:
- SSH2 and key files - chrisfleming, 2005-09-12, 18:46
- Re: SSH2 and key files - wodSupport, 2005-09-12, 19:41