Table of Contents

Property HostKeyFingerprints

Namespace
SshSharp.Extensions.DependencyInjection
Assembly
SshSharp.Extensions.DependencyInjection.dll

HostKeyFingerprints

Trust only these host keys, as Pinned(params string[]) does. Each entry is one of:

  • a SHA-256 fingerprint in OpenSSH's format (SHA256: and 43 base64 characters, as ssh-keygen -lf prints it);
  • a public key line, as the server's /etc/ssh/ssh_host_ed25519_key.pub holds it (ssh-ed25519 AAAA... comment, read by Parse(string));
  • a known_hosts line (host ssh-ed25519 AAAA...), as ssh-keyscan prints it. Its host field is not checked: the line pins the key. Marked lines (@cert-authority, @revoked) fail validation.

They replace known_hosts: setting KnownHostsFiles, AcceptNewHostKeys or ConfigAlias as well fails validation, so it is never unclear which of them decides. List more than one to allow for a host key rotation.

public IList<string> HostKeyFingerprints { get; set; }

Property Value

IList<string>