ssh

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package ssh provides the API for connecting to a SSH node. Once connected, reader and writer interface can be retrieved for the given connection using the GetVTY method. The reader and writer can be later used to receive/send data from/to the connected host. The package currently supports only the password authentication. Example of the usage:

conn, err := ssh.Connect("10.10.10.10", 22, "cisco", "cisco")
// handle error!
defer conn.Close()

r, w, err := conn.GetVTY()

This package can be used as a transport for the vty package, that provides the API to execute remote commands on a VTY connection.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

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

Connection represents a SSH connection.

func Connect

func Connect(host string, port uint32, userName string, password string) (*Connection, error)

Connect connects top a host via SSH using password authentication.

func (*Connection) Close

func (c *Connection) Close()

Close closes the SSH connection.

func (*Connection) GetVTY

func (c *Connection) GetVTY() (io.Reader, io.Writer, error)

GetVTY returns the interface to VTY for reading and writing.

Jump to

Keyboard shortcuts

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