ssh

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SSHConfigFile      = ".ssh/config"
	MultiKeyConfigFile = ".ssh/multikey.conf"
	IncludeDirective   = "Include ~/.ssh/multikey.conf"
)

Variables

This section is empty.

Functions

func CopyToClipboard

func CopyToClipboard(text string) error

CopyToClipboard copies text to the system clipboard

func GenerateKey

func GenerateKey(keyPath string) error

GenerateKey generates a new ED25519 SSH key pair

func GetPublicKey

func GetPublicKey(privateKeyPath string) (string, error)

GetPublicKey extracts the public key from a private key file

func KeyExists

func KeyExists(keyPath string) bool

KeyExists checks if a key file exists and is readable

func TestConnection

func TestConnection(identityFile string) error

TestConnection tests SSH connectivity to GitHub

Types

type Manager

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

Manager handles SSH configuration operations

func NewManager

func NewManager() (*Manager, error)

NewManager creates a new SSH config manager

func (*Manager) EnsureInclude

func (m *Manager) EnsureInclude() error

EnsureInclude ensures the SSH config includes the multikey config file

func (*Manager) GenerateConfig

func (m *Manager) GenerateConfig(profiles []Profile) error

GenerateConfig generates the multikey SSH config from profiles

func (*Manager) GetMultiKeyConfigPath

func (m *Manager) GetMultiKeyConfigPath() string

GetMultiKeyConfigPath returns the path to the multikey SSH config file

type Profile

type Profile struct {
	SSHHost      string
	IdentityFile string
}

Profile represents a profile for SSH config generation

Jump to

Keyboard shortcuts

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