Class ConnectionInfo
- Namespace
- Renci.SshNet
- Assembly
- Renci.SshNet.dll
Represents remote connection information class.
public class ConnectionInfo
Inheritance
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
host
string-
The host.
username
string-
The username.
authenticationMethods
AuthenticationMethod[]-
The authentication methods.
Exceptions
- ArgumentNullException
-
host
is null. - ArgumentException
-
host
is a zero-length string. - ArgumentException
-
username
is null, a zero-length string or contains only whitespace characters. - ArgumentNullException
-
authenticationMethods
is null. - ArgumentException
-
No
authenticationMethods
specified.
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
host
string-
The host.
port
int-
The port.
username
string-
The username.
authenticationMethods
AuthenticationMethod[]-
The authentication methods.
Exceptions
- ArgumentNullException
-
host
is null. - ArgumentException
-
username
is null, a zero-length string or contains only whitespace characters. - ArgumentOutOfRangeException
-
port
is not within System.Net.IPEndPoint.MinPort and System.Net.IPEndPoint.MaxPort. - ArgumentNullException
-
authenticationMethods
is null. - ArgumentException
-
No
authenticationMethods
specified.
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
host
string-
Connection host.
port
int-
Connection port.
username
string-
Connection username.
proxyType
ProxyTypes-
Type of the proxy.
proxyHost
string-
The proxy host.
proxyPort
int-
The proxy port.
proxyUsername
string-
The proxy username.
proxyPassword
string-
The proxy password.
authenticationMethods
AuthenticationMethod[]-
The authentication methods.
Exceptions
- ArgumentNullException
-
host
is null. - ArgumentException
-
username
is null, a zero-length string or contains only whitespace characters. - ArgumentOutOfRangeException
-
port
is not within System.Net.IPEndPoint.MinPort and System.Net.IPEndPoint.MaxPort. - ArgumentNullException
-
proxyType
is not Renci.SshNet.ProxyTypes.None andproxyHost
is null. - ArgumentOutOfRangeException
-
proxyType
is not Renci.SshNet.ProxyTypes.None andproxyPort
is not within System.Net.IPEndPoint.MinPort and System.Net.IPEndPoint.MaxPort. - ArgumentNullException
-
authenticationMethods
is null. - ArgumentException
-
No
authenticationMethods
specified.
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 IDictionary<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 IDictionary<string, CipherInfo> Encryptions { get; }
Property Value
HmacAlgorithms
Gets supported hash algorithms for this connection.
public IDictionary<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 IDictionary<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 IDictionary<string, Func<IKeyExchange>> KeyExchangeAlgorithms { get; }
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