Class ConnectionInfo
- Namespace
- Renci.SshNet
- Assembly
- Renci.SshNet.dll
Represents remote connection information class.
public class ConnectionInfoInheritance
Derived
Inherited Members
Remarks
This class is NOT thread-safe. Do not use the same Renci.SshNet.ConnectionInfo with multiple client instances.
Constructors
ConnectionInfo(string, string, params AuthenticationMethod[])
Initializes a new instance of the Renci.SshNet.ConnectionInfo class.
public ConnectionInfo(string host, string username, params AuthenticationMethod[] authenticationMethods)Parameters
hoststring-
The host.
usernamestring-
The username.
authenticationMethodsAuthenticationMethod[]-
The authentication methods.
Exceptions
- ArgumentNullException
-
hostis null. - ArgumentException
-
hostis a zero-length string. - ArgumentException
-
usernameis null, a zero-length string or contains only whitespace characters. - ArgumentNullException
-
authenticationMethodsis null. - ArgumentException
-
No
authenticationMethodsspecified.
ConnectionInfo(string, int, string, params AuthenticationMethod[])
Initializes a new instance of the Renci.SshNet.ConnectionInfo class.
public ConnectionInfo(string host, int port, string username, params AuthenticationMethod[] authenticationMethods)Parameters
hoststring-
The host.
portint-
The port.
usernamestring-
The username.
authenticationMethodsAuthenticationMethod[]-
The authentication methods.
Exceptions
- ArgumentNullException
-
hostis null. - ArgumentException
-
usernameis null, a zero-length string or contains only whitespace characters. - ArgumentOutOfRangeException
-
portis not within System.Net.IPEndPoint.MinPort and System.Net.IPEndPoint.MaxPort. - ArgumentNullException
-
authenticationMethodsis null. - ArgumentException
-
No
authenticationMethodsspecified.
ConnectionInfo(string, int, string, ProxyTypes, string, int, string, string, params AuthenticationMethod[])
Initializes a new instance of the Renci.SshNet.ConnectionInfo class.
public ConnectionInfo(string host, int port, string username, ProxyTypes proxyType, string proxyHost, int proxyPort, string proxyUsername, string proxyPassword, params AuthenticationMethod[] authenticationMethods)Parameters
hoststring-
Connection host.
portint-
Connection port.
usernamestring-
Connection username.
proxyTypeProxyTypes-
Type of the proxy.
proxyHoststring-
The proxy host.
proxyPortint-
The proxy port.
proxyUsernamestring-
The proxy username.
proxyPasswordstring-
The proxy password.
authenticationMethodsAuthenticationMethod[]-
The authentication methods.
Exceptions
- ArgumentNullException
-
hostis null. - ArgumentException
-
usernameis null, a zero-length string or contains only whitespace characters. - ArgumentOutOfRangeException
-
portis not within System.Net.IPEndPoint.MinPort and System.Net.IPEndPoint.MaxPort. - ArgumentNullException
-
proxyTypeis not Renci.SshNet.ProxyTypes.None andproxyHostis null. - ArgumentOutOfRangeException
-
proxyTypeis not Renci.SshNet.ProxyTypes.None andproxyPortis not within System.Net.IPEndPoint.MinPort and System.Net.IPEndPoint.MaxPort. - ArgumentNullException
-
authenticationMethodsis null. - ArgumentException
-
No
authenticationMethodsspecified.
Properties
AuthenticationMethods
Gets supported authentication methods for this connection.
public IList<AuthenticationMethod> AuthenticationMethods { get; }Property Value
ChannelCloseTimeout
Gets or sets the timeout to use when waiting for a server to acknowledge closing a channel.
public TimeSpan ChannelCloseTimeout { get; set; }Property Value
Remarks
If a server does not send a SSH_MSG_CHANNEL_CLOSE message before the specified timeout
elapses, the channel will be closed immediately.
ChannelRequests
Gets the supported channel requests for this connection.
public IDictionary<string, RequestInfo> ChannelRequests { get; }Property Value
ClientVersion
Gets the client version.
public string ClientVersion { get; }Property Value
CompressionAlgorithms
Gets supported compression algorithms for this connection.
public IOrderedDictionary<string, Func<Compressor>> CompressionAlgorithms { get; }Property Value
CurrentClientCompressionAlgorithm
Gets the current client compression algorithm.
public string CurrentClientCompressionAlgorithm { get; }Property Value
CurrentClientEncryption
Gets the current client encryption.
public string CurrentClientEncryption { get; }Property Value
CurrentClientHmacAlgorithm
Gets the current client hash algorithm.
public string CurrentClientHmacAlgorithm { get; }Property Value
CurrentHostKeyAlgorithm
Gets the current host key algorithm.
public string CurrentHostKeyAlgorithm { get; }Property Value
CurrentKeyExchangeAlgorithm
Gets the current key exchange algorithm.
public string CurrentKeyExchangeAlgorithm { get; }Property Value
CurrentServerCompressionAlgorithm
Gets the current server compression algorithm.
public string CurrentServerCompressionAlgorithm { get; }Property Value
CurrentServerEncryption
Gets the current server encryption.
public string CurrentServerEncryption { get; }Property Value
CurrentServerHmacAlgorithm
Gets the current server hash algorithm.
public string CurrentServerHmacAlgorithm { get; }Property Value
Encoding
Gets or sets the character encoding.
public Encoding Encoding { get; set; }Property Value
Encryptions
Gets supported encryptions for this connection.
public IOrderedDictionary<string, CipherInfo> Encryptions { get; }Property Value
HmacAlgorithms
Gets supported hash algorithms for this connection.
public IOrderedDictionary<string, HashInfo> HmacAlgorithms { get; }Property Value
Host
Gets connection host.
public string Host { get; }Property Value
HostKeyAlgorithms
Gets supported host key algorithms for this connection.
public IOrderedDictionary<string, Func<byte[], KeyHostAlgorithm>> HostKeyAlgorithms { get; }Property Value
IsAuthenticated
Gets a value indicating whether connection is authenticated.
public bool IsAuthenticated { get; }Property Value
KeyExchangeAlgorithms
Gets supported key exchange algorithms for this connection.
public IOrderedDictionary<string, Func<IKeyExchange>> KeyExchangeAlgorithms { get; }Property Value
LoggerFactory
Gets or sets logger factory for this connection.
public ILoggerFactory LoggerFactory { get; set; }Property Value
MaxSessions
Gets or sets maximum number of session channels to be open simultaneously.
public int MaxSessions { get; set; }Property Value
Port
Gets connection port.
public int Port { get; }Property Value
ProxyHost
Gets proxy connection host.
public string ProxyHost { get; }Property Value
ProxyPassword
Gets proxy connection password.
public string ProxyPassword { get; }Property Value
ProxyPort
Gets proxy connection port.
public int ProxyPort { get; }Property Value
ProxyType
Gets proxy type.
public ProxyTypes ProxyType { get; }Property Value
ProxyUsername
Gets proxy connection username.
public string ProxyUsername { get; }Property Value
RetryAttempts
Gets or sets number of retry attempts when session channel creation failed.
public int RetryAttempts { get; set; }Property Value
ServerVersion
Gets the server version.
public string ServerVersion { get; }Property Value
Timeout
Gets or sets connection timeout.
public TimeSpan Timeout { get; set; }Property Value
Username
Gets connection username.
public string Username { get; }Property Value
AuthenticationBanner
Occurs when authentication banner is sent by the server.
public event EventHandler<AuthenticationBannerEventArgs> AuthenticationBanner