Table of Contents

Class SshClientSettings

Namespace
Tmds.Ssh
Assembly
Tmds.Ssh.dll

Settings for configuring SshClient.

public sealed class SshClientSettings
Inheritance
SshClientSettings
Inherited Members

Constructors

SshClientSettings()

Creates default settings.

public SshClientSettings()

SshClientSettings(string)

Creates settings for the specified destination.

public SshClientSettings(string destination)

Parameters

destination string

The destination in format [user@]host[:port].

Properties

AutoConnect

Gets or sets whether to automatically connect when the client is used.

public bool AutoConnect { get; set; }

Property Value

bool

Remarks

Defaults to true.

AutoReconnect

Gets or sets whether to automatically reconnect when the client is used after an unexpected disconnect.

public bool AutoReconnect { get; set; }

Property Value

bool

Remarks

Defaults to false.

BatchMode

Gets or sets whether to enable batch mode (no interactive prompts).

public bool BatchMode { get; set; }

Property Value

bool

Remarks

Defaults to false.

ClientKeyAlgorithms

Gets or sets the signature algorithms allowed for client key authentication.

public AlgorithmList? ClientKeyAlgorithms { get; set; }

Property Value

AlgorithmList

Remarks

This limits how Credentials can be used for authentication based on the key signature algorithms. When null, all supported algorithms are allowed.

ConnectTimeout

Gets or sets the connection timeout.

public TimeSpan ConnectTimeout { get; set; }

Property Value

TimeSpan

Remarks

Defaults to 15 seconds.

Credentials

Gets or sets the credentials for authentication.

public List<Credential> Credentials { get; set; }

Property Value

List<Credential>

Remarks

Defaults to DefaultCredentials.

DefaultCredentials

Gets the default Credential list used for authentication.

public static IReadOnlyList<Credential> DefaultCredentials { get; }

Property Value

IReadOnlyList<Credential>

Remarks

This contains private key credentials from ~/.ssh/id_ed25519, ~/.ssh/id_ecdsa, and ~/.ssh/id_rsa; certificate credentials from ~/.ssh/id_ed25519-cert.pub, ~/.ssh/id_ecdsa-cert.pub, and ~/.ssh/id_rsa-cert.pub; SshAgentCredentials, KerberosCredential, and NoCredential.

DefaultGlobalKnownHostsFilePaths

Gets the default global known hosts file paths.

public static IReadOnlyList<string> DefaultGlobalKnownHostsFilePaths { get; }

Property Value

IReadOnlyList<string>

Remarks

On Unix this contains /etc/ssh/ssh_known_hosts and /etc/ssh/ssh_known_hosts2. On Windows this contains %ProgramData%/ssh/ssh_known_hosts and %ProgramData%/ssh/ssh_known_hosts2.

DefaultUserKnownHostsFilePaths

Gets the default user known hosts file paths.

public static IReadOnlyList<string> DefaultUserKnownHostsFilePaths { get; }

Property Value

IReadOnlyList<string>

Remarks

This contains ~/.ssh/known_hosts.

EnableBatchModeWhenConsoleIsRedirected

Gets or sets whether to enable batch mode when console is redirected.

public bool EnableBatchModeWhenConsoleIsRedirected { get; set; }

Property Value

bool

Remarks

Defaults to true.

EncryptionAlgorithmsClientToServer

Gets or sets the permitted ciphers for client to server communication in order of preference.

public AlgorithmList EncryptionAlgorithmsClientToServer { get; set; }

Property Value

AlgorithmList

EncryptionAlgorithmsServerToClient

Gets or sets the permitted ciphers for server to client communication in order of preference.

public AlgorithmList EncryptionAlgorithmsServerToClient { get; set; }

Property Value

AlgorithmList

EnvironmentVariables

Gets or sets environment variables for all remote processes.

public Dictionary<string, string> EnvironmentVariables { get; set; }

Property Value

Dictionary<string, string>

GlobalKnownHostsFilePaths

Gets or sets the paths to global known hosts files.

public List<string> GlobalKnownHostsFilePaths { get; set; }

Property Value

List<string>

Remarks

HashKnownHosts

Gets or sets whether to hash hostnames in the known hosts file.

public bool HashKnownHosts { get; set; }

Property Value

bool

Remarks

Defaults to false.

HostAuthentication

Gets or sets the HostAuthentication delegate.

public HostAuthentication? HostAuthentication { get; set; }

Property Value

HostAuthentication

Remarks

This delegate is not called when the host key is known to be trusted or revoked.

HostName

Gets or sets the hostname or IP address of the server.

public string HostName { get; set; }

Property Value

string

KeepAliveCountMax

Gets or sets the maximum number of keep-alive messages before disconnecting.

public int KeepAliveCountMax { get; set; }

Property Value

int

Remarks

Defaults to 3.

KeepAliveInterval

Gets or sets the interval between keep-alive messages.

public TimeSpan KeepAliveInterval { get; set; }

Property Value

TimeSpan

Remarks

Defaults to Zero.

KeyExchangeAlgorithms

Gets or sets the permitted key exchange algorithms in order of preference.

public AlgorithmList KeyExchangeAlgorithms { get; set; }

Property Value

AlgorithmList

MacAlgorithmsClientToServer

Gets or sets the permitted integrity algorithms for client to server communication in order of preference.

public AlgorithmList MacAlgorithmsClientToServer { get; set; }

Property Value

AlgorithmList

MacAlgorithmsServerToClient

Gets or sets the permitted integrity algorithms for server to client communication in order of preference.

public AlgorithmList MacAlgorithmsServerToClient { get; set; }

Property Value

AlgorithmList

MinimumRSAKeySize

Gets or sets the minimum RSA key size accepted for authentication.

public int MinimumRSAKeySize { get; set; }

Property Value

int

Remarks

Defaults to 2048.

Port

Gets or sets the server port.

public int Port { get; set; }

Property Value

int

Remarks

Defaults to 22.

Proxy

Gets or sets the Proxy configuration for the connection.

public Proxy? Proxy { get; set; }

Property Value

Proxy

ServerHostKeyAlgorithms

Gets or sets the host key signature algorithms in order of preference.

public AlgorithmList ServerHostKeyAlgorithms { get; set; }

Property Value

AlgorithmList

ServerHostKeyCertificateAlgorithms

Gets or sets the permitted algorithms allowed for signing of certificates by certificate authorities (CAs).

public AlgorithmList ServerHostKeyCertificateAlgorithms { get; set; }

Property Value

AlgorithmList

Remarks

The client will not accept host certificates signed using algorithms other than those specified.

TcpKeepAlive

Gets or sets whether to enable TCP keep-alive.

public bool TcpKeepAlive { get; set; }

Property Value

bool

Remarks

Defaults to true.

UpdateKnownHostsFileAfterAuthentication

Gets or sets whether to update the known hosts file after authentication.

public bool UpdateKnownHostsFileAfterAuthentication { get; set; }

Property Value

bool

Remarks

Defaults to false.

UserKnownHostsFilePaths

Gets or sets the paths to user known hosts files.

public List<string> UserKnownHostsFilePaths { get; set; }

Property Value

List<string>

Remarks

UserName

Gets or sets the username.

public string UserName { get; set; }

Property Value

string

Remarks

Defaults to UserName.