ssh

package
v0.8.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2016 License: MPL-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultUser is used if there is no user given
	DefaultUser = "root"

	// DefaultPort is used if there is no port given
	DefaultPort = 22

	// DefaultScriptPath is used as the path to copy the file to
	// for remote execution if not provided otherwise.
	DefaultScriptPath = "/tmp/terraform_%RAND%.sh"

	// DefaultTimeout is used if there is no timeout given
	DefaultTimeout = 5 * time.Minute
)
View Source
const (
	// DefaultShebang is added at the top of a SSH script file
	DefaultShebang = "#!/bin/sh\n"
)

Variables

This section is empty.

Functions

func BastionConnectFunc added in v0.6.0

func BastionConnectFunc(
	bProto string,
	bAddr string,
	bConf *ssh.ClientConfig,
	proto string,
	addr string) func() (net.Conn, error)

BastionConnectFunc is a convenience method for returning a function that connects to a host over a bastion connection.

func ConnectFunc

func ConnectFunc(network, addr string) func() (net.Conn, error)

ConnectFunc is a convenience method for returning a function that just uses net.Dial to communicate with the remote end that is suitable for use with the SSH communicator configuration.

func PasswordKeyboardInteractive

func PasswordKeyboardInteractive(password string) ssh.KeyboardInteractiveChallenge

An implementation of ssh.KeyboardInteractiveChallenge that simply sends back the password for all questions. The questions are logged.

Types

type Communicator

type Communicator struct {
	// contains filtered or unexported fields
}

Communicator represents the SSH communicator

func New

New creates a new communicator implementation over SSH.

func (*Communicator) Connect

func (c *Communicator) Connect(o terraform.UIOutput) (err error)

Connect implementation of communicator.Communicator interface

func (*Communicator) Disconnect

func (c *Communicator) Disconnect() error

Disconnect implementation of communicator.Communicator interface

func (*Communicator) ScriptPath

func (c *Communicator) ScriptPath() string

ScriptPath implementation of communicator.Communicator interface

func (*Communicator) Start

func (c *Communicator) Start(cmd *remote.Cmd) error

Start implementation of communicator.Communicator interface

func (*Communicator) Timeout

func (c *Communicator) Timeout() time.Duration

Timeout implementation of communicator.Communicator interface

func (*Communicator) Upload

func (c *Communicator) Upload(path string, input io.Reader) error

Upload implementation of communicator.Communicator interface

func (*Communicator) UploadDir

func (c *Communicator) UploadDir(dst string, src string) error

UploadDir implementation of communicator.Communicator interface

func (*Communicator) UploadScript

func (c *Communicator) UploadScript(path string, input io.Reader) error

UploadScript implementation of communicator.Communicator interface

Jump to

Keyboard shortcuts

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