Table of Contents

Class SshConfigResolveOptions

Namespace
SshSharp.Config
Assembly
SshSharp.dll

Inputs to Resolve(string, SshConfigResolveOptions?) that come from outside the config file.

public sealed class SshConfigResolveOptions
Inheritance
SshConfigResolveOptions
Inherited Members

Properties

Command

The command (with SessionType exec) or subsystem name (with subsystem, for example sftp) the caller will start, for Match command; null or empty for none, which Match command "" matches. Used only when SessionType is set.

ExecMatcher

Evaluates Match exec commands (after token expansion): completes with true when the command succeeds. Null (the default) means exec criteria never match, because running commands from a config file is opt-in; for trusted files, run them with RunShellAsync(string, CancellationToken): (command, ct) => new(SshExecMatcher.RunShellAsync(command, ct)). Asynchronous, so a config that needs it resolves with ResolveAsync(string, SshConfigResolveOptions?, CancellationToken).

GetEnvironmentVariable

Looks up environment variables for ${VAR} expansion. Defaults to the process environment.

HomeDirectory

The home directory (~, %d). Defaults to the current user's profile folder.

HostCanonicalizer

Looks up the canonical name for CanonicalizeHostname: receives the host and the CanonicalDomains and completes with the canonical name, or null when none is found. Null (the default) disables canonicalization, since resolving names is the caller's business (DNS, CanonicalizePermittedCNAMEs policy). Asynchronous, so a config that needs it resolves with ResolveAsync(string, SshConfigResolveOptions?, CancellationToken).

LocalAddresses

The local addresses for Match localnetwork. Null (the default) reads the addresses of the network interfaces that are up, as ssh does; set it to decide yourself (or in tests). Note that a network address is not a trustworthy criterion in many situations, as ssh_config(5) warns.

LocalHostName

The local host name (%l, %L). Defaults to the machine name.

LocalUser

The local user name (%u, and the default remote user). Defaults to the current user.

Port

A port given explicitly by the caller; overrides Port in the file.

SessionType

The kind of session the caller will start, for Match sessiontype: shell (an interactive shell), exec (a command), subsystem (for example SFTP) or none (forwarding only, ssh -N). Null (the default) when unknown: a Match block with sessiontype or command then never applies, negated or not, since either answer could be wrong. ssh itself always knows, because the command line says.

Tag

A tag given by the caller (ssh -P), matched by Match tagged; overrides Tag in the file.

User

A user given explicitly by the caller; overrides User in the file.