Stopped working - WeOnlyDo Discussion board

Stopped working (wodSSH / wodSSH.NET)

by schenkp, Monday, March 22, 2010, 14:02 (5361 days ago)

Hi,
We have been using the following code in production for about 6 months with no issues. We recently updated our Debian lab clients from etch to lenny versions of Debian which broke the code somehow. Each time we go to authenticate we get the following error message Authentication with server failed , not sure how what to change on the SSH.NET code to help remedy the issue.

Thoughts?

WeOnlyDo.Client.SSH ssh1 = new WeOnlyDo.Client.SSH();

System.Collections.IDictionary envVars = Environment.GetEnvironmentVariables();

string endVLC = killall -q vlc ;

String hostname_value = ;

private void data(string streamPath)
{
System.Collections.IDictionary envVars = Environment.GetEnvironmentVariables();

foreach (System.Collections.DictionaryEntry envVar in envVars)
{

if (envVar.Key.ToString() == ThinConnectedFrom )
{
hostname_value = envVar.Value.ToString();
}
}

WeOnlyDo.Client.SSH ssh1 = new WeOnlyDo.Client.SSH();
ssh1.Hostname = hostname_value;
ssh1.Protocol = WeOnlyDo.Client.SSH.SupportedProtocols.SSHAuto;
ssh1.Login = user ;
ssh1.Password = XXXX ;
ssh1.Blocking = true;
ssh1.Command = streamPath;

try
{
ssh1.LicenseKey = XXXX ;
ssh1.Connect();
String result = ssh1.Receive();
System.IO.File.WriteAllText( C:\Temp\ThinTV.txt , result);

}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}

}

Re: Stopped working

by woddrazen, Monday, March 22, 2010, 14:22 (5361 days ago) @ schenkp

Hi,


Can you maybe try to connect there using some other SSH client like Putty for example?

Does it work with other clients maybe?

Let us know how it goes.


Regards,
Drazen

Re: Stopped working

by schenkp, Monday, March 22, 2010, 14:33 (5361 days ago) @ woddrazen

Yes we can connect with the username and password we are using in the code below using putty with no issues. But we get the error message when using the code below.

Hi,


Can you maybe try to connect there using some other SSH client like Putty for example?

Does it work with other clients maybe?

Let us know how it goes.


Regards,
Drazen

Re: Stopped working

by woddrazen, Monday, March 22, 2010, 14:41 (5361 days ago) @ schenkp

Hi,


Can you please check which version of wodSSH.NET you are using? You can check version using wodSSH.NET Version Property.

Also did you try to connect to your server using our samples maybe? Does it work like that?


Drazen

Re: Stopped working

by schenkp, Monday, March 22, 2010, 15:02 (5361 days ago) @ woddrazen

We are using production version 2.4.4.114.

Re: Stopped working

by schenkp, Monday, March 22, 2010, 15:16 (5361 days ago) @ schenkp

Works perfectly with the sample Terminal CS Sample , what do we do now?

Re: Stopped working

by woddrazen, Monday, March 22, 2010, 15:34 (5361 days ago) @ schenkp

Hi,


I'm not sure, your code look much same. Maybe you insert hostname, login or password value incorrectly. Can you maybe check that?

What happens if you run this simple code:
[code]ssh1 = new WeOnlyDo.Client.SSH();

ssh1.Hostname = your:hostname ;
ssh1.Blocking = true;
ssh1.Protocol = WeOnlyDo.Client.SSH.SupportedProtocols.SSHAuto;
ssh1.Login = your_login ;
ssh1.Password = your_password ;
ssh1.Connect();

MessageBox.Show(ssh1.Receive());[/code]
Drazen