Documentation
¶
Index ¶
- func AcceptNewHostKeyCallback(knownHostsPath string) (ssh.HostKeyCallback, error)
- func AuthMethods(identityPath string) ([]ssh.AuthMethod, error)
- func Dial(cfg *config.Config) (*ssh.Client, error)
- func JoinShell(parts []string) string
- func ParseUserHost(remoteSSH string) (user, address string, err error)
- func QuoteArgs(args []string) string
- func RunBash(client *ssh.Client, script string, tty bool) error
- func RunBashOpts(client *ssh.Client, script string, tty bool, opts BashOpts) error
- func RunRemotePipe(client *ssh.Client, script string, stdin io.Reader) error
- func ShellQuote(s string) string
- type BashOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AcceptNewHostKeyCallback ¶
func AcceptNewHostKeyCallback(knownHostsPath string) (ssh.HostKeyCallback, error)
AcceptNewHostKeyCallback behaves like OpenSSH StrictHostKeyChecking=accept-new: unknown keys are appended to knownHostsPath; mismatches are rejected.
func AuthMethods ¶
func AuthMethods(identityPath string) ([]ssh.AuthMethod, error)
AuthMethods returns SSH auth methods: optional identity file (if readable), then ssh-agent.
func Dial ¶
Dial opens an SSH client using cfg (remote_ssh, ssh_identity) and accept-new known_hosts.
func ParseUserHost ¶
ParseUserHost parses remote_ssh as user@host or user@host:port or user@[ipv6]:port.
func RunBashOpts ¶
RunBashOpts is like RunBash with extra options for TTY sessions.
func RunRemotePipe ¶
RunRemotePipe runs bash -lc script with stdin connected (e.g. docker save | ssh … docker load).
func ShellQuote ¶
ShellQuote returns s safe for POSIX sh single-quoted strings.
Types ¶
type BashOpts ¶
type BashOpts struct {
// RawLocalStdin puts the client's stdin in raw mode so keys (e.g. Ctrl+D / EOT) reach the remote shell.
RawLocalStdin bool
// CloseSessionOnInterrupt ends the SSH session on local Ctrl+C / SIGTERM instead of forwarding
// ssh.SIGINT to the remote shell. Use for dq logs -f: dropping the session stops log streaming.
// Do not set for dq exec -it, where SIGINT must reach the container shell.
CloseSessionOnInterrupt bool
}
BashOpts tweaks interactive (TTY) SSH sessions (e.g. dq exec, dq logs -f).