ssh

package module
v0.0.0-...-9566af6 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2021 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SessionVariableStreams

func SessionVariableStreams(s *ssh.Session) (*bytes.Buffer, *bytes.Buffer)

SessionVariableStreams sets a session's stdout and stderr streams to a byte buffer for later retrieval

Types

type Client

type Client struct {
	AuthMethods  []ssh.AuthMethod
	ClientConfig *ssh.ClientConfig
	Connection   *ssh.Client
}

Client holds the client and related package info for an SSH client

func NewClient

func NewClient() *Client

NewClient instantiates a new client for the SSH package

func (*Client) Connect

func (c *Client) Connect(host, port string)

Connect instantiates an SSH client

func (*Client) GetClientConfig

func (c *Client) GetClientConfig(username string)

GetClientConfig returns a SSH client config

func (*Client) GetKeyAuthMethod

func (c *Client) GetKeyAuthMethod(keyPath, passPhrase string)

GetKeyAuthMethod instantiates an auth method for a key "passPhrase" contains an optional passphrase for an ssh key

func (*Client) GetPasswordAuthMethod

func (c *Client) GetPasswordAuthMethod(password string)

GetPasswordAuthMethod instantiates an auth method using a password

func (*Client) GetSSHAgentAuthMethod

func (c *Client) GetSSHAgentAuthMethod()

GetSSHAgentAuthMethod instantiates an auth method using the SSH agent

func (*Client) NewSession

func (c *Client) NewSession() *ssh.Session

NewSession instantiates an SSH session

Jump to

Keyboard shortcuts

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