ssh

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package ssh provides SSH key management helpers for ssmx.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultKeyPath

func DefaultKeyPath() string

DefaultKeyPath returns the first existing standard SSH public key path, checking id_ed25519, id_rsa, id_ecdsa in order. Returns "" if none exist.

func DefaultSSHUser

func DefaultSSHUser(platformName string) string

DefaultSSHUser returns the default SSH username for the given SSM PlatformName. Falls back to "ec2-user" for unknown platforms.

func LoadOrGenerateKey

func LoadOrGenerateKey(keyPath string) (pubKey string, resolvedPath string, err error)

LoadOrGenerateKey returns the public key contents for keyPath. If keyPath is "", it generates a new ed25519 keypair at ~/.ssmx/ssh_key and returns the public key. If the key already exists at that path, it is reused without regenerating.

Types

This section is empty.

Jump to

Keyboard shortcuts

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