knownhosts

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2024 License: Apache-2.0, BSD-3-Clause Imports: 13 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(b []byte) (ssh.HostKeyCallback, error)

New creates a host key callback from the given OpenSSH host key file bytes. The returned callback is for use in ssh.ClientConfig.HostKeyCallback. By preference, the key check operates on the hostname if available, i.e. if a server changes its IP address, the host key check will still succeed, even though a record of the new IP address is not available.

Types

type KnownKey added in v0.4.0

type KnownKey struct {
	// contains filtered or unexported fields
}

func ParseKnownHosts added in v0.4.0

func ParseKnownHosts(s string) ([]KnownKey, error)

ParseKnownHosts takes a string with the contents of known_hosts, parses it and returns a slice of KnownKey

func (KnownKey) Matches added in v0.4.0

func (k KnownKey) Matches(host string, fingerprint []byte) bool

Matches checks if the specified host is present and if the fingerprint matches the present public key key.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL