ssh

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2017 License: Apache-2.0 Imports: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestConnection

func TestConnection(ip string, port int, user, key string) error

TestConnection connects to ip:port as user with key and immediately exits.

func ValidUnencryptedPrivateKey

func ValidUnencryptedPrivateKey(file string) error

ValidUnencryptedPrivateKey parses SSH private key

Types

type Client

type Client interface {
	Output(pty bool, args ...string) (string, error)
	Shell(pty bool, args ...string) error
}

func NewClient added in v1.2.1

func NewClient(host string, port int, user string, key string) (Client, error)

NewClient verifies ssh is available in the PATH and returns an SSH client

type ExternalClient added in v1.2.1

type ExternalClient struct {
	BaseArgs   []string
	BinaryPath string
	// contains filtered or unexported fields
}

func (*ExternalClient) Output added in v1.2.1

func (client *ExternalClient) Output(pty bool, args ...string) (string, error)

Output runs the ssh command and returns the output

func (*ExternalClient) Shell added in v1.2.1

func (client *ExternalClient) Shell(pty bool, args ...string) error

Shell runs the ssh command, binding Stdin, Stdout and Stderr

Jump to

Keyboard shortcuts

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