SSH Class
wodSSH.NET Component Documentation

SSH Class

Implements code for SSH (Secure shell) client component.

For a list of all members of this type, see SSH Members.

System.Object
   MarshalByRefObject
      Component
         SSH

[Visual Basic]
Public Class SSH
Inherits Component
[C#]
public class SSH : Component

Remarks

wodSSH.NET is a client component that provides support for communication with remote console-type services. It allows you to communicate encrypted (and secured, of course) with SSH1 and SSH2 (secure-shell) servers, as well as old-style Telnet server that support Telnet protocol (or any other plaintext protocol). For ones that don't know - the SSH transport layer is a secure low level transport protocol. It provides strong encryption, cryptographic host authentication, and integrity protection.

With wodSSH.NET you can connect to SSH servers, which are standard today in remote console communication. wodSSH.NET is able to automatically determine if remote server is based on SSH1 or SSH2 protocol version, and communicate accordingly. It will provide you with information about remote server Fingerprint, so you can always get authenticated information about remote server.

wodSSH.NET can be used as scripting client. Easily, you can set it up to connect to server, execute one or more commands, wait for response, and just disconnect. And all of it fully automated. It also supports blocking and non-blocking operations, thus it's suitable for many environments, such as ASP.NET.

When you're unsure when to send actual command, wodSSH.NET may help also. Using it's unique Prompt property, it can fire event for you whenever remote server sent command prompt to enter new command. All you have to do is send new command once this event is fired.

Code example in Visual Basic:

Dim WithEvents Ssh1 As WeOnlyDo.Client.SSH
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  ' Initialize new instance
        Ssh1 = New WeOnlyDo.Client.SSH()
  ' Set your login/username
        Ssh1.Login = "your login"
  ' Set your password
        Ssh1.Password = "your password"
  ' Any encryption is ok
        Ssh1.Encryption = WeOnlyDo.Client.SSH.EncryptionMethods.Auto
  ' Set SSH version 
        Ssh1.Protocol = SSH1
  ' Define command which we'll send to the server
 Ssh1.Command = "ls -al" & Chr(10)
  ' Connect, finally. Now wait for Connected event to fire
 Ssh1.Connect("your.host.com")
End Sub

Code example in C#:

using WeOnlyDo.Client;
SSH Ssh1;
private void Form1_Load(object sender, System.EventArgs e)
{
  // Initialize new instance
 Ssh1 = new SSH();
  // defined somewhere in the code
        Ssh1.ConnectedEvent += new WeOnlyDo.Client.SSH.ConnectedDelegate(Ssh1_Connected);
  // Set your login/username
        Ssh1.Login = "your login";
  // Set your password
        Ssh1.Password = "your password";
  // Any encryption is ok
        Ssh1.Encryption = WeOnlyDo.Client.SSH.EncryptionMethods.Auto;
  // Set SSH version
        Ssh1.Protocol = SSH1;
  // Define command which we'll send to the server
 Ssh1.Command = "ls -al\n";
  // Connect, finally. Now wait for Ssh1_Connected event to occur
 Ssh1.Connect(TextBox2.Text);
}

Requirements

Namespace: WeOnlyDo.Client

Assembly: WeOnlyDo.Client.SSH (in WeOnlyDo.Client.SSH.dll)

See Also

SSH Members | WeOnlyDo.Client Namespace