Table of Contents

Property ConfirmAddKeyToAgent

Namespace
SshSharp
Assembly
SshSharp.dll

ConfirmAddKeyToAgent

Answers AddKeysToAgent ask: called for each identity-file key the server accepted, before it goes to the agent, as ssh asks through SSH_ASKPASS ("Add key ... to agent?"). Complete with true to add it (with no lifetime or confirmation constraint, as ssh adds it), false to leave it out. Without it, or in BatchMode, ask adds nothing, as ssh does when it cannot ask. Called after the connection is made; the caller's token, not ConnectTimeout, bounds it. What it throws closes the new connection and is thrown from ConnectAsync.

public Func<SshAddKeyToAgentPrompt, CancellationToken, ValueTask<bool>>? ConfirmAddKeyToAgent { get; init; }

Property Value

Func<SshAddKeyToAgentPrompt, CancellationToken, ValueTask<bool>>