Table of Contents

Method Add

Namespace
SshSharp.Config
Assembly
SshSharp.dll

Add(string, int, string, ReadOnlySpan<byte>, bool, string?, KnownHostsMarker)

Appends an entry for a host.

public KnownHostsEntry Add(string host, int port, string keyType, ReadOnlySpan<byte> publicKey, bool hash = false, string? comment = null, KnownHostsMarker marker = KnownHostsMarker.None)

Parameters

host string

The host name or address.

port int

The port.

keyType string

The key type, for example ssh-ed25519.

publicKey ReadOnlySpan<byte>

The public key blob.

hash bool

Whether to store the host hashed (HashKnownHosts).

comment string

An optional comment.

marker KnownHostsMarker

An optional marker.

Returns

KnownHostsEntry