Table of Contents

Property PasswordProvider

Namespace
SshSharp
Assembly
SshSharp.dll

PasswordProvider

Asks for the password when authentication reaches it, as ssh prompts user@host's password:: only after the keys (and Kerberos) did not log in, so an interactive tool prompts only when it has to. It is called again after each refused password, at most NumberOfPasswordPrompts times per connection; return null to stop asking. It answers the password method, and keyboard-interactive the way Password does (a round that asks for exactly one hidden input) when there is no KeyboardInteractive handler. A Password that is set is tried first.

public Func<SshPasswordPrompt, CancellationToken, ValueTask<string?>>? PasswordProvider { get; init; }

Property Value

Func<SshPasswordPrompt, CancellationToken, ValueTask<string>>

Remarks

It gets the connect's cancellation token; an exception it throws (an OperationCanceledException when the user cancels) fails the connect. The password is sent to the server being authenticated with only, and is not kept.