SshAuthenticationAgent Class
Namespace: Rebex.Net
Assembly: Rebex.Networking.dll (version 7.0.9083)
Represents the client side of the SSH authentication agent that implements SSH Agent Protocol (RFC https://datatracker.ietf.org/doc/html/draft-miller-ssh-agent-00). This class is abstract, but it is not expected that you derive from it. Instead, use static (shared in VB) properties to obtain already implemented clients for OpenSshAgent, Pageant and LegacyPageant SSH authentication agent servers. The SSH agent server provides a private key for authentication of Ssh, FileTransferClient, Sftp and Scp clients to an SSH server. See remarks for details.
Syntax
public abstract class SshAuthenticationAgent
Inherited Members
Remarks
- OpenSshAgent is supported on Windows and Unix operating systems. OpenSshAgent communicates with server via named pipe on Windows and via domain socket on Unix. To programmatically determine if the agent is supported on the current platform and with the selected .NET/.NET Framework version, use the IsOpenSshAgentSupported property.
- Pageant is supported on Windows only. Pageant communicates via named pipe. To programmatically determine if the agent is supported on the current platform and with the selected .NET/.NET Framework version, use the IsPageantSupported property.
- LegacyPageant is supported on Windows only. LegacyPageant sends windows message to initiate communication with the server, after that client and server exchange messages via memory-mapped file. To programmatically determine if the agent is supported on the current platform and with the selected .NET/.NET Framework version, use the IsLegacyPageantSupported property.
Examples
//Create instance of the Sftp class.
using Sftp sftpClient = new();
//Connect to SFTP server.
sftpClient.Connect(sftpServerIp, sftServerPort);
//Logon to the SFTP server and authenticates using the public key authentication.
//sftpClient uses OpenSSH authentication agent that should contain one or more private keys for the user.
sftpClient.Login(userName, SshAuthenticationAgent.OpenSshAgent);
Properties
Name | Description |
---|---|
IsLegacyPageantSupported | Gets the value that indicates whether the client for legacy Pageant authentication agent server is supported on the current platform and/or with the selected .NET/.NET Framework version. |
IsOpenSshAgentSupported | Gets the value that indicates whether the client for OpenSSH authentication agent server is supported on the current platform and/or with the selected .NET/.NET Framework version. |
IsPageantSupported | Gets the value that indicates whether the client for Pageant authentication agent server is supported on the current platform and/or with the selected .NET/.NET Framework version. |
LegacyPageant | Gets the client for legacy Pageant SSH authentication agent server. |
OpenSshAgent | Gets the client for OpenSSH authentication agent server. |
Pageant | Gets the client for Pageant SSH authentication agent server. |
Type | Gets the type of the SshAuthenticationAgent |