ssh

package
v0.0.0-...-f6b9a2a Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateSSHKeyPair

func CreateSSHKeyPair(dirName string) (pub, priv string, err error)

func FindOpenIPs

func FindOpenIPs(ips []net.IP, numNeeded int) (openIPs []net.IP, err error)

func FindUnusedOpenLocalPort

func FindUnusedOpenLocalPort(min, max int) (port int, err error)

func GetSubnetRange

func GetSubnetRange(first, last net.IP) (ips []net.IP)

func LoadAndRunScript

func LoadAndRunScript(scriptURL, accessToken string, envs map[string]any) (fullCommandlet string)

func MustLocalIP

func MustLocalIP() string

func ParseSubnet

func ParseSubnet(cidr string) (firstIP, lastIP net.IP, block *net.IPNet, err error)

Given a "cidr" string like "10.255.255.0/24", return the first & last usable addresses, the cidr block, and any error encountered.

func PingHost

func PingHost(ipAddress string) (pinged bool)

func SetEnvs

func SetEnvs(envs map[string]any) (result string)

func WaitOnline

func WaitOnline(ipAddress string) (err error)

func WithKeyboardInteractivePassword

func WithKeyboardInteractivePassword(password string) ssh.AuthMethod

func WithPassword

func WithPassword(password string) ssh.AuthMethod

func WithPrivateKey

func WithPrivateKey(key []byte) ssh.AuthMethod

Types

type SSHConnection

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

func Connect

func Connect(username, host string, port int, authMethods ...ssh.AuthMethod) (conn *SSHConnection, err error)

func ConnectOnceReadyWithRetry

func ConnectOnceReadyWithRetry(username, host string, port int, retries int, authMethods ...ssh.AuthMethod) (conn *SSHConnection, err error)

func (*SSHConnection) Close

func (conn *SSHConnection) Close() (err error)

func (*SSHConnection) Reset

func (conn *SSHConnection) Reset() (err error)

If you've run a command and want to run another, you need to reset the session

func (*SSHConnection) Send

func (conn *SSHConnection) Send(command string) (err error)

func (*SSHConnection) SendWithOutput

func (conn *SSHConnection) SendWithOutput(command string) (status int, output []byte, err error)

Jump to

Keyboard shortcuts

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