Tag Archives: timeout

SSh, .NET and solving timeout issue

I was asked to develop an asp.net mvc solution which gets some data from linux server using ssh. The command I use in ssh client in putty works pretty well, but when I wanted to use those commands using SSH.NET, it took a long time and finally timed out. I finally got an idea to have all my commands in one shell scripting file and call that script with SSH.NET library.

var client = new SshClient(“serveripaddress”, sshport, "user", "pass");
client.Connect();
var cm1 = client.RunCommand("sh shellfilename");

But it was some other issue in shell scripting. As I was new to shell scripting in linux, I did not know how to call to command one after other, because the second command has dependency on first command. I asked a question on stackexchange, and I got what I wanted.