sshhost

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package sshhost checks SSH targets and host keys for `ce install ssh`. ce runs the system ssh client (with the SSH agent); this package decides which host key ssh may accept. A host key is never skipped: it must be in the user's known_hosts, match --host-key, or be confirmed by the user.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Known

func Known(file, name string, key Key) bool

Known reports whether a known_hosts file has this key for this name (plain or hashed). Revoked and @cert-authority lines never match.

func Line

func Line(name string, key Key) string

Line is a known_hosts line for this name and key.

Types

type Key

type Key struct {
	Type string
	Blob string
}

Key is a host key: its type and its base64 blob.

func ParseKeyscan

func ParseKeyscan(out string) []Key

ParseKeyscan reads the output of ssh-keyscan.

func (Key) Fingerprint

func (k Key) Fingerprint() string

Fingerprint is the SHA256 fingerprint, as ssh shows it.

type Target

type Target struct {
	User string
	Host string
}

Target is user@host.

func ParseTarget

func ParseTarget(value string) (Target, error)

ParseTarget reads user@host (default user root). It refuses anything that ssh could read as an option or that is not a host name or an IP address.

func (Target) KnownName

func (t Target) KnownName(port string) string

KnownName is the name of the host in known_hosts for this port.

func (Target) String

func (t Target) String() string

String is user@host, with brackets for IPv6.

Jump to

Keyboard shortcuts

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