Class SshConfig
An OpenSSH client configuration (ssh_config): parsed into Host sections and resolved per host with
OpenSSH's first-obtained-value-wins rules.
public sealed class SshConfig
- Inheritance
-
SshConfig
- Inherited Members
Properties
- Blocks
The sections of every loaded file in order; the first section of each file is its global part before any
Hostline.
Methods
- Combine(params SshConfig[])
Combines several configs; earlier ones take precedence (first obtained value wins).
- Load(string, string?)
Loads a config file. A missing file gives an empty config. See Parse(string, string?) for
baseDirectory.
- LoadAsync(string, string?, CancellationToken)
Loads a config file asynchronously. A missing file gives an empty config.
- LoadDefault(string?)
Loads the standard files like
sshdoes: the user's~/.ssh/configfirst, then the system-wide file (/etc/ssh/ssh_config, or%ProgramData%\ssh\ssh_configon Windows). Earlier files win.
- Parse(string, string?)
Parses
ssh_configtext. Throws FormatException (with the line number) on syntax errors.
- Resolve(string, SshConfigResolveOptions?)
Resolves the effective settings for
host.
- ResolveAsync(string, SshConfigResolveOptions?, CancellationToken)
Resolves the effective settings for
host, as Resolve(string, SshConfigResolveOptions?) does, awaiting ExecMatcher and HostCanonicalizer when the config needs them (Match exec,CanonicalizeHostname).