Help us shape the future of Go! Take the 2026 Go Developer Survey

sshhostkeys

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package sshhostkeys verifies the SSH host keys of Prism instances (#739).

Every ssh invocation used to pass StrictHostKeyChecking=no and UserKnownHostsFile=/dev/null, so a host key was never checked or remembered: anyone in the network path, or holding a recycled public IP, could impersonate an instance and receive Jupyter tokens, template scripts, files and port forwards.

Keys are recorded on first use (StrictHostKeyChecking=accept-new) and checked on every later connection, in a Prism-owned known_hosts file. They are keyed by instance ID through HostKeyAlias, not by IP: EC2 reuses public IPs, so an IP-keyed entry would falsely reject the next instance that gets the address, while an ID-keyed entry belongs to exactly one instance for its whole life.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Forget

func Forget(instanceID string) error

Forget removes the recorded host key of an instance, e.g. when it is terminated. A missing file or entry is not an error.

func KnownHostsPath

func KnownHostsPath() string

KnownHostsPath is Prism's ssh known_hosts file, beside the daemon state (PRISM_STATE_DIR, else ~/.prism).

func Options

func Options(instanceID string) []string

Options returns the ssh "-o" arguments that verify the host key of the given instance. With an empty instanceID the key is keyed by whatever host ssh connects to (still verified, but exposed to IP reuse), so callers should pass the ID.

Types

This section is empty.

Jump to

Keyboard shortcuts

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