Websphere Connection Timing Out (General questions)
In my environment I have windows and unix machines I need to connect to and run commands against. The code below works great for my windows machines but causes a timeout on the WaitFor() call. The events show it going from Disconnected to Connecting then Connecting to Connected.
My windows machines run F-Secure and the unix websphere server returns this for the RemoteIdentification property SSH-2.0-Sun_SSH_1.0.1 . I have tried varying terminal types and the response is the same. What am I doing wrong?
_sshClient = new SSH();
_sshClient.AllocatePty = false;
_sshClient.LicenseKey = GetLicKey();
_sshClient.Hostname = _server;
_sshClient.Login = _login;
_sshClient.Password = _pass;
_sshClient.Protocol = WeOnlyDo.Client.SSH.SupportedProtocols.SSHAuto;
_sshClient.Blocking = true;
_sshClient.Timeout = 10;
_sshClient.PromptReceivedEvent += new WeOnlyDo.Client.SSH.PromptReceivedDelegate(_sshClient_PromptReceivedEvent);
_sshClient.DataReceivedEvent += new WeOnlyDo.Client.SSH.DataReceivedDelegate(_sshClient_DataReceivedEvent);
_sshClient.StateChangedEvent += new WeOnlyDo.Client.SSH.StateChangedDelegate(_sshClient_StateChangedEvent);
_sshClient.ShowStdErrorMessages = true;
Trace.WriteLine( Establishing connection );
_sshClient.Connect();
Trace.WriteLine(_sshClient.WaitFor(_prompt));
Re: Websphere Connection Timing Out
Hi David,
What is the prompt that you are expecting after connect to that server?
You can try with regular expression $ #>] that accepts any of those chars $, ,#,> if they appear at the end of the line.
This includes 99.9 of most UNIX command prompts (including root account).
Here is example in VB6:
Ssh1.WaitFor( regex:[$ #>] $ )
Hope this helps.
Regards,
Drazen
Re: Websphere Connection Timing Out
Hello Drazen,
That is the prompt I have been using based on some other message board posts I had seen. The actual prompt on the unix machine is user@servername$ which I have tried directly and no dice. Other suggestions?
-David
Re: Websphere Connection Timing Out
Hi Sam,
You mention that you have F-Secure install on your machine.
What exactly type and version of F-Secure you have installed on your machine?
That will help us to duplicate your problem.
Did you try to connect to that server with any other SSH client like PuTTy for example?
You use in your code AllocatePty Property can you set it to true ( _sshClient.AllocatePty = true ) and try again to connect?
It would be best if we can connect to your server and try if it works for us, is this possible?
You can send us information how to connect to techsupport@weonlydo.com.
Regards,
Drazen
Re: Websphere Connection Timing Out
The AllocatePty property was the issue. Thanks for the very prompt help.