Table of Contents

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 KnownHostsCommand may be run (a local shell command whose output is trusted as known_hosts lines). Default false: unlike ProxyCommand, 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 ProxyCommand may be run (it is a local shell command, as in OpenSSH). Default true.

AskHostKey

Answers StrictHostKeyChecking ask for an unknown host key (see AskHostKey). Not called in BatchMode.

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, ask leaves known_hosts alone. Not called in BatchMode.

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, with KbdInteractiveAuthentication 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 in BatchMode. Without it, encrypted identity files are skipped.

Password

The destination's password, sent with the password method unless PasswordAuthentication is no, or through keyboard-interactive (see Password) unless KbdInteractiveAuthentication is no. 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 exec runner, ...). Default: the current process's.

StartForwardings

Start the destination's LocalForward, RemoteForward and DynamicForward forwardings 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, ExitOnForwardFailure and ClearAllForwardings apply.

UseAgent

Whether to offer the SSH agent's keys, as ssh does: the agent named by IdentityAgent, or FromEnvironment(). With IdentitiesOnly yes, only agent keys that match an IdentityFile are offered. Default true.