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

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

by gmcfarlane, Tuesday, January 18, 2005, 04:13 (7248 days ago)

Hi

I am trying to log into a server w/ a 2048 DSA key generated by putty. Not having a lot of luck.

I have been given an account but told that the account password is disabled.

First, the key has a passphrase. I am not sure where to put this using wodSSH.

Second, wodSSH doesnt seem to like the ppk private key file that putty generates. I did some playing around w/ puttygen and found the export. does wodSSH want to use the .PEM format? it loads this file but I am not getting connected.

I am using the public key example that came in the download. The only changes I made are that I hardcoded the path to the server and my public key in the text boxes so I could cycle tests quickly and not worry about finger farts.

When I try to connect, it says

I have sent the SSH server's admin some sample keys, one w/ a pass phrase and one without. He says he can connect fine w/ both.


I am new to SSH. If there is a manual somewhere that I should read just let me know.

Re: Example of logging in w/ a public key

by gmcfarlane, Tuesday, January 18, 2005, 05:53 (7248 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);


Re: Example of logging in w/ a public key

by wodSupport, Tuesday, January 18, 2005, 12:15 (7248 days ago) @ gmcfarlane

Greg,

just by looking at your code and explanation, all seems to work correctly. I assume you tried to connect with Putty and it worked, right?

If so, is there any chance you could send me your key and your code so I can try to connect and debug, to see what's going on under the hood and why are you being rejected? If you can, please send it to techsupport@weonlydo.com

Thanks.