ssh

package
v0.0.0-...-efb87f3 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrNotReady will be returned if the SSH transport is not ready when
	// calling Connect.
	ErrNotReady = errors.New("ssh transport is not ready")
)

Functions

func Init

func Init(db database.ReadWriter) error

Init will initiate internal structures for the SSH transport including generating a private key.

func PublicKey

func PublicKey() string

PublicKey will generate a public key formatted for use in ~/.ssh/authorized_keys.

Types

type SSH

type SSH struct {
	database.Object `storm:"inline"`

	Address  string `json:"address" description:"Hostname or IP address to connect to (1.2.3.4 or 1.2.3.4:22)"`
	Username string `json:"username" description:"Username"`
}

SSH is a transport using ordinary SSH access.

func (*SSH) Dial

func (s *SSH) Dial(network string, address string) (net.Conn, error)

Dial implements transports.Transport.

func (*SSH) Exec

func (s *SSH) Exec(cmd string, arguments ...string) (io.Reader, io.Reader, error)

Exec executes a binary on the remote host.

func (*SSH) ReadFile

func (s *SSH) ReadFile(path string) ([]byte, error)

ReadFile will read a complete file from the remote.

Jump to

Keyboard shortcuts

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