fingerprintverifier

package module
v0.0.0-...-6bc1342 Latest Latest
Warning

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

Go to latest
Published: May 25, 2021 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Warner = func(msg string) {
	fmt.Fprintln(os.Stderr, "WARNING: "+msg)
}

Warner is a function that gets called when the fingerprint verifier wants to show a warning. By default it prints the warning to stderr. This is a variable so you can replace it if you want to suppress or handle the warnings. Here is an example of a string that would get passed to this function:

not validating host key nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8 for github.com

Functions

func New

func New(fingerprint string) ssh.HostKeyCallback

New returns a function matching the ssh.HostKeyCallback type that can be passed as the HostKeyCallback in the ssh ClientConfig. The fingerprint may be in the format

MD5:16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48
16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48
MD5:16:27:AC:A5:76:28:2D:36:63:1B:56:4D:EB:DF:A6:48
16:27:AC:A5:76:28:2D:36:63:1B:56:4D:EB:DF:A6:48
SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8
nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8

To get a host's fingerprint run this (replace github.com with your host):

ssh-keyscan github.com | ssh-keygen -lf -

If an empty string is given this will print a warning using Warner() containing the SHA256 key.

Types

This section is empty.

Jump to

Keyboard shortcuts

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