Re: Problem mit Trial of SSH-Server - WeOnlyDo Discussion board

Re: Problem mit Trial of SSH-Server (General questions)

by Michael, Wednesday, January 20, 2010, 09:45 (5204 days ago) @ wodDamir

Hi!

Works now.
I am trying to build an simple application which just takes public key auth and supports port forwarding.
Here my approach using c#:

[code]
private void Form1_Load(object sender, EventArgs e)
{
ssh = new wodSSHDComLIB.wodSSHDComClass();
String FileName = AppDomain.CurrentDomain.BaseDirectory + server.rsa ;
if (System.IO.File.Exists(FileName) == false)
{
ssh.Keys.Generate(wodSSHDComLIB.SSHKeyTypes.RSAkey, 1024);
ssh.Keys.Save(wodSSHDComLIB.SSHKeyTypes.RSAkey, FileName, null);
}
else
{
ssh.Keys.Load(FileName, null);
ssh.Port = 22;
}
ssh.LoginPubkey += new wodSSHDComLIB._IwodSSHDComEvents_LoginPubkeyEventHandler(ssh_LoginPubkey);
ssh.ServiceRequest += new wodSSHDComLIB._IwodSSHDComEvents_ServiceRequestEventHandler(ssh_ServiceRequest);
ssh.Start(ssh.Port);

MessageBox.Show( started );
}

void ssh_LoginPubkey(wodSSHDComLIB.SSHUser User, string Login, string PublicKey, ref wodSSHDComLIB.SSHActions Action)
{
MessageBox.Show( Login Request );
String pkey_file = Application.StartupPath + \keys\ + Login;
if (File.Exists(pkey_file))
{
StreamReader reader = new StreamReader(pkey_file);
String pkey = reader.ReadToEnd();
reader.Close();
lbl1.Text = pkey +

+ PublicKey;
if (pkey.Equals(PublicKey)) Action = wodSSHDComLIB.SSHActions.Allow;
else Action = wodSSHDComLIB.SSHActions.Deny;
}
else
{
Action = wodSSHDComLIB.SSHActions.Deny;
}
}
[/code]

I get the MessageBox started , but the others are never fired..
Did I forget something?

Thanks for help!

Hi Michael,

Can you please make sure that you force your application to compile as 32-bit?

In Visual Studio, just set Target CPU to x86, and it should work.

Can you please try that?

Regards,
Damba


Complete thread: