ssh

package
v0.0.0-...-0abd718 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2025 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Ep config.EndpointInfo = config.EndpointInfo{
	Name:           "container-node",
	User:           "linuxserver.io",
	Host:           "localhost",
	Port:           2222,
	PrivateKeyPath: "keys/id_rsa",
}
View Source
var ErrEmptyPrivKeyPath = errors.New("Private key path is empty")
View Source
var ErrNotSupported = errors.New("Authentication method not supported")
View Source
var ErrPrivKetFileNotFound = errors.New("Public key file was not found")
View Source
var ErrPrivateKeyParse = errors.New("Private key file could not be parsed")

Functions

func AddHostKeyToKnownHosts

func AddHostKeyToKnownHosts(host string, port string) error

func CreateSSHServerContainer

func CreateSSHServerContainer(pubKey string) (testcontainers.Container, error)

func CreateTestConfig

func CreateTestConfig() (*ssh.ClientConfig, error)

func NewSSHConn

func NewSSHConn(ep config.EndpointInfo, cfg *ssh.ClientConfig) (*ssh.Client, error)

Creates a new SSH connection using the provided configuration. you need to have an SSH config. you can use the ssh.BuildConfig function in order create it.

Types

type SSHConnConfig

type SSHConnConfig struct {
	Username       string
	PrivateKeyPath string
}

Configuration for creating an ssh connection.

func (SSHConnConfig) BuildConfig

func (s SSHConnConfig) BuildConfig() (*ssh.ClientConfig, error)

BuildConfig builds a new SSH client configuration using username, and a path to the private key that the SSH server authenticates against.

Jump to

Keyboard shortcuts

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