Class SshConfigConnectOptions
- Namespace
- SshSharp
- Assembly
- SshSharp.dll
Options for ConnectAsync(string, SshConfigConnectOptions?, CancellationToken), which takes everything else
from ssh_config: host name, port, user, identity files, known_hosts and StrictHostKeyChecking, algorithms, ProxyJump,
ProxyCommand, ServerAliveInterval, ConnectTimeout and AddressFamily.
public sealed class SshConfigConnectOptions
- Inheritance
-
SshConfigConnectOptions
- Inherited Members
Properties
- Agent
The agent to use instead of the configured or environment one.
- AllowKnownHostsCommand
Whether a configured
KnownHostsCommandmay be run (a local shell command whose output is trusted as known_hosts lines). Default false: unlikeProxyCommand, which only carries the connection, this one decides which host keys are trusted, so a configuration the application does not control must not be able to supply them. Off, a configuration that names one fails the connection rather than silently checking fewer keys than it says.
- AllowProxyCommand
Whether a configured
ProxyCommandmay be run (it is a local shell command, as in OpenSSH). Default true.
- AskHostKey
Answers
StrictHostKeyChecking askfor an unknown host key (see AskHostKey). Not called inBatchMode.
- AuthenticationBanner
Receives the server's pre-authentication banner (see AuthenticationBanner).
- Config
The configuration to resolve against. Default: the user's and the system's files (LoadDefault(string?)).
- ConfirmHostKeyUpdate
Confirms known_hosts changes under
UpdateHostKeys ask(see ConfirmHostKeyUpdate). Without it,askleaves known_hosts alone. Not called inBatchMode.
- HostKeyVerifier
Replaces the default host key verification, which is a KnownHostsVerifier built from the host's configuration (
UserKnownHostsFile,GlobalKnownHostsFile,StrictHostKeyChecking,HashKnownHosts).
- KeyboardInteractive
Answers the destination's keyboard-interactive authentication (see KeyboardInteractive). Not called in
BatchMode, withKbdInteractiveAuthentication no, or for a ProxyJump hop.
- Logger
Receives diagnostics for this connection and every jump host.
- PassphraseProvider
Asked for the passphrase of an encrypted
IdentityFile(the argument is the file's path). Return null to skip that key. Not called inBatchMode. Without it, encrypted identity files are skipped.
- Password
The destination's password, sent with the
passwordmethod unlessPasswordAuthenticationisno, or through keyboard-interactive (see Password) unlessKbdInteractiveAuthenticationisno. Never offered to a ProxyJump hop, which logs in with keys or the agent.
- PrivateKeys
Keys to offer before the configured
IdentityFiles. The client does not dispose them.
- Proxy
An HTTP or SOCKS proxy for the first network hop: the destination, or the first ProxyJump host (later hops are reached through SSH). Not used for a host with a
ProxyCommand, which makes its own connection.
- ResolveOptions
Inputs for resolution (home directory, environment,
Match execrunner, ...). Default: the current process's.
- StartForwardings
Start the destination's
LocalForward,RemoteForwardandDynamicForwardforwardings once connected, as ssh does (see LocalForwardings and its siblings). Off by default: forwardings open listening ports, which a library should not do unasked.GatewayPorts,ExitOnForwardFailureandClearAllForwardingsapply.
- UseAgent
Whether to offer the SSH agent's keys, as ssh does: the agent named by
IdentityAgent, or FromEnvironment(). WithIdentitiesOnly yes, only agent keys that match anIdentityFileare offered. Default true.