ssh

package
v0.11.8 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2020 License: MIT Imports: 6 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.11.2

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.11.2

func ConnectTimeoutFlag(timeout int) 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

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

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.11.2

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