ssh

package
v0.13.0-beta4 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package ssh provides utility functions for interfacing with OpenSSH.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompressionFlag added in v0.13.0

func CompressionFlag() string

CompressionFlag returns a flag that can be passed to scp or ssh to enable compression. Note that while SSH does have a CompressionLevel configuration option, this only applies to SSHv1. SSHv2 defaults to a DEFLATE level of 6, which is what we want anyway.

func ConnectTimeoutFlag added in v0.13.0

func ConnectTimeoutFlag(timeout uint64) string

ConnectTimeoutFlag returns a flag that can be passed to scp or ssh to limit connection time. The provided timeout is in seconds. The timeout must be greater than 0, otherwise this function will panic.

func SCPCommand added in v0.13.0

func SCPCommand(context context.Context, args ...string) (*exec.Cmd, error)

SCPCommand prepares (but does not start) an SCP command with the specified arguments and scoped to lifetime of the provided context.

func SSHCommand added in v0.13.0

func SSHCommand(context context.Context, args ...string) (*exec.Cmd, error)

SSHCommand prepares (but does not start) an SSH command with the specified arguments and scoped to lifetime of the provided context.

func ServerAliveFlags added in v0.13.0

func ServerAliveFlags(interval, countMax int) []string

ServerAliveFlags returns a set of flags that can be passed to scp or ssh to enable use of server alive messages. The provided interval is in seconds. Both the interval and count must be greater than 0, otherwise this function will panic.

Types

This section is empty.

Jump to

Keyboard shortcuts

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