Ssh Class
Namespace: Rebex.Net
Assembly: Rebex.SshShell.dll (version 7.0.9147)
Provides methods for communication with SSH shell servers.
Syntax
public class Ssh : NetworkSession, ILogWriterProvider, IDisposable, IShellChannelFactory
Inherited Members
Remarks
All members of this class are thread-safe.
Constructors
Name | Description |
---|---|
Ssh() | Initializes a new instance of the Ssh class. |
Fields
Name | Description |
---|---|
Default |
Default SSH port (22). |
Properties
Name | Description |
---|---|
Default |
Gets or sets a default log writer used by all new instances of Network |
Encoding | Gets or sets the Encoding to use to encode and decode command parameters and server responses. |
Fingerprint | Gets the server public key fingerprint (a SHA-256 hash of the server public key). |
Instance |
Gets instance ID (intended for logging purposes).
Inherited from Network |
Is |
Gets a value indicating whether the session is authenticated. |
Is |
Gets a value indicating whether the session is connected. |
Is |
Gets a value indicating whether the object is disposed. |
Local |
Gets the local client End |
Log |
Gets or sets the Log |
Proxy | Gets or sets the network proxy to use to access a remote server. |
Remote |
Gets the remote server End |
Server |
Gets the server public key. |
Server |
Gets the server name, if available.
Inherited from Network |
Server |
Gets the server port, if available.
Inherited from Network |
Session | Gets the SSH session used by this SSH session. |
Settings | Gets or sets SSH object settings. |
Timeout | Gets or sets the length of time in milliseconds before the operation times out (specify -1 or 0 to indicate that the request does not time out). |
User |
Gets the authenticated user name, if available.
Inherited from Network |
Version | Gets the version of the SSH component. |
Methods
Name | Description |
---|---|
Bind(Ssh |
Binds the Ssh object to an underlying SSH session. This can be used instead of Connect(String)/Login(String, String) methods. |
Check |
Checks whether the SSH session is still connected. Throws an exception on error. |
Connect(String) | Connects to the SSH server. |
Connect(String, Int32) | Connects to the SSH server. |
Connect |
Begins asynchronous Connect operation. Connects to the SSH server. |
Connect |
Begins asynchronous Connect operation. Connects to the SSH server. |
Disconnect() | Informs the server that the connection is about to close and terminates the connection. |
Disconnect |
Begins asynchronous Disconnect operation. Informs the server that the connection is about to close and terminates the connection. |
Dispose() | Disposes the Ssh object and all the socket objects. |
Dispose(Boolean) | Releases the unmanaged resources used by the Ssh object and optionally releases the managed resources. |
Finalize() | Finalizer. Called by garbage collector during object destruction. |
Get |
Checks whether the SSH session is still connected and returns its state. |
Get |
Gets hash code for this object.
Inherited from Network |
Login() | Authenticates the user to the server interactively and initializes the SSH session.
Uses Authentication |
Login(Ssh |
Authenticates to the server using GSSAPI. Kerberos is only supported on Mono. NTLM is supported on Windows and partially on Mono. |
Login(String) | Authenticates the user to the server interactively and initializes the SSH session.
Uses Authentication |
Login(String, Ssh |
Authenticates the user to the server using his private key and initializes the SSH session. |
Login(String, Ssh |
Authenticates the user to the server using his private key and initializes the SSH session. |
Login(String, String) | Authenticates the user to the server and initializes the SSH session. |
Login(String, String, Ssh |
Authenticates the user to the server using a combination of password and public key and initializes the SSH session. |
Login(String, String, Ssh |
Authenticates the user to the server using a combination of password and public key and initializes the SSH session. |
Login |
Begins asynchronous Login operation. Authenticates to the server using GSSAPI. Kerberos is only supported on Mono. NTLM is supported on Windows and partially on Mono. |
Login |
Begins asynchronous Login operation.
Authenticates the user to the server interactively and initializes the SSH session.
Uses Authentication |
Login |
Begins asynchronous Login operation. Authenticates the user to the server using his private key and initializes the SSH session. |
Login |
Begins asynchronous Login operation. Authenticates the user to the server using his private key and initializes the SSH session. |
Login |
Begins asynchronous Login operation.
Authenticates the user to the server interactively and initializes the SSH session.
Uses Authentication |
Login |
Begins asynchronous Login operation. Authenticates the user to the server using a combination of password and public key and initializes the SSH session. |
Login |
Begins asynchronous Login operation. Authenticates the user to the server using a combination of password and public key and initializes the SSH session. |
Login |
Begins asynchronous Login operation. Authenticates the user to the server and initializes the SSH session. |
Run |
Runs a remote command and returns its response. Returns null reference (Nothing in Visual Basic) if the end of response has been reached without any preceding data. |
Run |
Begins asynchronous RunCommand operation. Runs a remote command and returns its response. Returns null reference (Nothing in Visual Basic) if the end of response has been reached without any preceding data. |
Set |
Sets the socket factory to be used to create communication sockets. |
Start |
Starts a remote command. |
Start |
Begins asynchronous StartCommand operation. Starts a remote command. |
Start |
Starts a new incoming tunnel. Connections to remote endpoint will be tunneled from the SSH server through the local machine to the specified target. |
Start |
Starts a new incoming tunnel. Connections to remote endpoint will be tunneled from the SSH server through the local machine to the specified target. |
Start |
Starts a new incoming tunnel. Connections to remote address/port will be tunneled from the SSH server through the local machine to the specified target. |
Start |
Starts a new incoming tunnel. Connections to remote endpoint will be tunneled from the SSH server through the local machine to the specified target. |
Start |
Begins asynchronous StartIncomingTunnel operation. Starts a new incoming tunnel. Connections to remote endpoint will be tunneled from the SSH server through the local machine to the specified target. |
Start |
Begins asynchronous StartIncomingTunnel operation. Starts a new incoming tunnel. Connections to remote endpoint will be tunneled from the SSH server through the local machine to the specified target. |
Start |
Begins asynchronous StartIncomingTunnel operation. Starts a new incoming tunnel. Connections to remote address/port will be tunneled from the SSH server through the local machine to the specified target. |
Start |
Begins asynchronous StartIncomingTunnel operation. Starts a new incoming tunnel. Connections to remote endpoint will be tunneled from the SSH server through the local machine to the specified target. |
Start |
Starts a new outgoing tunnel. Connections to local endpoint will be tunneled through the SSH server to the specified remote endpoint. |
Start |
Starts a new outgoing tunnel. Connections to local endpoint will be tunneled through the SSH server to the specified remote host/port. |
Start |
Starts a new outgoing tunnel. Connections to local host/port will be tunneled through the SSH server to the specified remote host/port. |
Start |
Begins asynchronous StartOutgoingTunnel operation. Starts a new outgoing tunnel. Connections to local endpoint will be tunneled through the SSH server to the specified remote endpoint. |
Start |
Begins asynchronous StartOutgoingTunnel operation. Starts a new outgoing tunnel. Connections to local endpoint will be tunneled through the SSH server to the specified remote host/port. |
Start |
Begins asynchronous StartOutgoingTunnel operation. Starts a new outgoing tunnel. Connections to local host/port will be tunneled through the SSH server to the specified remote host/port. |
Start |
Starts a scripting session with a virtual terminal. |
Start |
Starts a scripting session with a virtual terminal. |
Start |
Starts a scripting session with a virtual terminal. |
Start |
Starts a scripting session with a virtual terminal. |
Start |
Starts a scripting session with a virtual terminal. |
Start |
Begins asynchronous StartScripting operation. Starts a scripting session with a virtual terminal. |
Start |
Begins asynchronous StartScripting operation. Starts a scripting session with a virtual terminal. |
Start |
Begins asynchronous StartScripting operation. Starts a scripting session with a virtual terminal. |
Start |
Begins asynchronous StartScripting operation. Starts a scripting session with a virtual terminal. |
Start |
Begins asynchronous StartScripting operation. Starts a scripting session with a virtual terminal. |
Start |
Starts a remote shell. |
Start |
Begins asynchronous StartShell operation. Starts a remote shell. |
Start |
Starts a new outgoing tunnel. Connections to local endpoint will be tunneled through the SSH server to the specified remote host/port. |
Start |
Starts a new outgoing tunnel. Connections to local host/port will be tunneled through the SSH server to the specified remote host/port. |
Start |
Begins asynchronous StartSocksServer operation. Starts a new outgoing tunnel. Connections to local endpoint will be tunneled through the SSH server to the specified remote host/port. |
Start |
Begins asynchronous StartSocksServer operation. Starts a new outgoing tunnel. Connections to local host/port will be tunneled through the SSH server to the specified remote host/port. |
Start |
Starts a virtual terminal session. |
Start |
Starts a virtual terminal session. |
Start |
Starts a virtual terminal session. |
Start |
Begins asynchronous StartVirtualTerminal operation. Starts a virtual terminal session. |
Start |
Begins asynchronous StartVirtualTerminal operation. Starts a virtual terminal session. |
Start |
Begins asynchronous StartVirtualTerminal operation. Starts a virtual terminal session. |
To |
Returns a string representation of this object. |
Events
Name | Description |
---|---|
Authentication |
Occurs when an authentication request is received from the server that cannot be answered programmatically. |
Banner |
Occurs when a banner message is received from the server. |
Fingerprint |
Occurs when a fingerprint is received from the server and needs to be validated. |
Tunnel |
Occurs when a tunnel fails with an error. |
Explicit Interface Implementations
Name | Description |
---|---|
IShell |
Creates a new shell channel using the specified options. |