sshx

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package sshx provides shared SSH helper utilities used across pgtransfer.

It intentionally depends only on the standard library and golang.org/x/crypto so that it can be imported from any package without introducing import cycles.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildAuthMethods

func BuildAuthMethods(cfg Config) ([]ssh.AuthMethod, error)

BuildAuthMethods constructs the ordered list of SSH authentication methods. It always prefers the ssh-agent (when SSH_AUTH_SOCK is set), then an explicit private key, and finally password authentication.

func ReadPrivateKey

func ReadPrivateKey(path string) ([]byte, error)

ReadPrivateKey reads an SSH private key file from disk.

Types

type Config

type Config struct {
	User       string
	Host       string
	Port       int
	KeyPath    string
	Passphrase string
	Password   string
	Timeout    int
}

Config mirrors the SSH portion of a connection profile. It is defined here (rather than importing internal/config) to avoid import cycles.

Jump to

Keyboard shortcuts

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