Re: Example of logging in w/ a public key - WeOnlyDo Discussion board

Re: Example of logging in w/ a public key (General questions)

by gmcfarlane, Tuesday, January 18, 2005, 05:53 (7046 days ago) @ gmcfarlane

a little more info

I found the second signature for LoadKey. Good thing it wasnt a snake. I am now correctly loading the keys w/ a passphrase.

However, I am still not getting connected. The Terminal PubKey CS Sample project gives the following output when I try to connect.

CONNECTING

DISCONNECTED
ERROR: Authentication with the server failed.


I have sent two sets of keys (pvt and pub) to the server admin. one w/ a passphrase and one w/o. He says he has the accounts set up and he can get in w/ no problem. I get the same results w/ both keys.

AAAAAARRRRGGGGHHHHHh.
------------------------------------------------------------
here is the code, (it should look pretty familiar). I have triple checked the contents of the textboxes.


Ssh1.Protocol = WeOnlyDo.Client.SSH.SupportedProtocols.SSH2;
Ssh1.Timeout = 30;
Ssh1.Port = 22;

WeOnlyDo.Security.Cryptography.KeyManager km = new WeOnlyDo.Security.Cryptography.KeyManager();
WeOnlyDo.Security.Cryptography.SSHKeyTypes type ;

try
{

Ssh1.Authentication = WeOnlyDo.Client.SSH.Authentications.PublicKey;
//type = WeOnlyDo.Security.Cryptography.SSHKeyTypes.DSAKey;

type = km.Load(textBox4.Text, dogcatchicken );
//type = km.Load(@ c:Private Key.pem , password );

Console.WriteLine(km.PublicKeyOpenSSH(type));
Ssh1.PrivateKey = km.PrivateKey(type );
Ssh1.Login = TextBox3.Text;
Ssh1.Password = ;

}
catch (Exception ex)
{
TextBox1.Text = ex.Message;
}

Ssh1.Connect(TextBox2.Text);



Complete thread: