Documentation
¶
Index ¶
- func ControlMasterArgs() []string
- func ParseSSHHost(host string) (user, addr string)
- func SSHCommand(contextName, sshHost, remoteCmd string) *exec.Cmd
- func SSHCommandTTY(contextName, sshHost, remoteCmd string) *exec.Cmd
- func ShellQuote(s string) string
- func SplitHostPort(addr string) (string, string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ControlMasterArgs ¶
func ControlMasterArgs() []string
ControlMasterArgs returns ssh flags enabling connection multiplexing. All ssh invocations for the same host (docker dial-stdio, tunnels, remote exec) share a single TCP/SSH connection: one handshake, then near-instant channel openings. This also avoids tripping sshd MaxStartups when many connections are opened concurrently.
func ParseSSHHost ¶
ParseSSHHost splits "user@host[:port][/]" into user and "host:port". User defaults to root, port to 22.
func SSHCommand ¶
SSHCommand builds an ssh invocation running remoteCmd on sshHost, using the stored credentials of contextName (key, passphrase or password served via SSH_ASKPASS) and connection multiplexing.
func SSHCommandTTY ¶
SSHCommandTTY is like SSHCommand but forces a pseudo-terminal, for interactive remote commands (editors, shells).
func ShellQuote ¶
ShellQuote quotes s for safe interpolation in a remote shell command.
func SplitHostPort ¶
SplitHostPort splits "host:port", defaulting the port to 22.
Types ¶
This section is empty.