Documentation
¶
Overview ¶
Package ssh provides SSH connectivity utilities for remote server automation. It wraps github.com/sfreiberg/simplessh with a simplified API for playbook-style operations where you connect, run commands, and disconnect.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrivateKeyPath ¶
PrivateKeyPath constructs the absolute path to an SSH private key file. It combines the current user's home directory with the .ssh directory and the provided key filename.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps an SSH connection with convenient methods for running commands.
func NewClient ¶
NewClient creates a new SSH client configuration. The host parameter should be just the hostname or IP (e.g., "db3.sinevia.com"). The port parameter is the SSH port (e.g., "22" or "40022"). The key parameter is just the filename (e.g., "2024_sinevia.prv"), which gets resolved to ~/.ssh/<key>.