Documentation
¶
Overview ¶
Package ssh provides SSH connectivity to StereOS sandbox VMs.
Index ¶
Constants ¶
const ( // SSHKeyFilename is the name of the ephemeral private key file // stored in the VM directory. SSHKeyFilename = "ssh_key" // SSHPubKeyFilename is the name of the ephemeral public key file // stored in the VM directory. SSHPubKeyFilename = "ssh_key.pub" )
Variables ¶
This section is empty.
Functions ¶
func ExecSSH ¶
ExecSSH replaces the current process with the ssh binary, providing a clean interactive experience. Signal handling, terminal resizing, SSH agent forwarding, and ~. escape sequences all work correctly because the user talks directly to OpenSSH.
If identityFile is non-empty, it is passed as -i to ssh along with -o IdentitiesOnly=yes to prevent the SSH agent or default keys from being tried (which could exhaust MaxAuthTries before the correct ephemeral key is attempted).
func GenerateKeyPair ¶
GenerateKeyPair creates a fresh Ed25519 SSH keypair in the given directory. It writes the private key (OpenSSH PEM format, mode 0600) and the public key (authorized_keys format, mode 0644) to <dir>/ssh_key and <dir>/ssh_key.pub respectively.
Returns the absolute path to the private key and the public key string (suitable for injection into authorized_keys).
func SSHKeyPath ¶
SSHKeyPath returns the path to the ephemeral SSH private key for a VM directory, or empty string if it doesn't exist.
func WaitForSSH ¶
WaitForSSH polls the given address (host:port) until a TCP connection succeeds or the timeout (in seconds) expires.
Types ¶
This section is empty.