sshclient

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 26, 2022 License: MIT Imports: 10 Imported by: 2

README

sshclient

Simple SSH client library

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SSHClient

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

SSHClient represents a simple SSH client, which uses password authentication.

func NewWithPassword

func NewWithPassword(username string, password string) *SSHClient

NewWithPassword creates a new SSH client with password authentication, and no host key check

func (*SSHClient) CopyFrom

func (sc *SSHClient) CopyFrom(address string, remotePath string, localPath string, recurseDir bool) error

CopyFrom copies a file or directory from the specified address.

func (*SSHClient) CopyTo

func (sc *SSHClient) CopyTo(address string, localPath string, remotePath string, recurseDir bool) error

CopyTo copies a local file or directory to the specified address.

func (*SSHClient) RunInterativeShell

func (sc *SSHClient) RunInterativeShell(address string)

RunInterativeShell connects to the specified address and runs an interactive shell.

func (*SSHClient) RunWithResults

func (sc *SSHClient) RunWithResults(address string, command string) (string, error)

RunWithResults connects to the specified address, runs the specified command, and fetches the results.

Jump to

Keyboard shortcuts

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