tags:

views:

116

answers:

2

I would like to know how to open putty using C# in Visual Basic express. Then execute commands through the ssh session.

A: 

I recently had to do something similar with WinSCP and the way I did it was to kick off the process with redirected Standard Input and Output. If Putty use the the standard input/output you might be able to use the same method for that.

The sample on the WinSCP pages is quite good so I'd suggest starting with that, and here's a code project article about something similar: How to redirect Standard Input/Output of an application

ho1
+1  A: 

What you actually need is an SSH component for .NET, capable of providing shell and command channel access to the remote host. Shell is what you see with PuTTY. You "type" the requests and get some response, which you need to parse then to separate responses from command prompt. Command channel is when the commands are sent one by one and you receive only response(s) back. You don't need to parse anything (besides handling actual responses). Simple components can't send multiple commands in one session.

You can take our SSH component for .NET, that offers both shell and command channels, and supports many types of authentication (so it doesn't matter what authentication type your server uses - our component supports it).

Eugene Mayevski 'EldoS Corp