sshclient

package module
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: MIT Imports: 10 Imported by: 1

README

sshclient

Simple SSH client library for the kutti project.

Go Report Card PkgGoDev GitHub release (latest by date)

Documentation

Overview

Package sshclient provides a simple SSH client that uses password authentication for now. It contains functions for starting an interactive shell, running commands remotely and copying files to and from remote hosts.

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) RunInteractiveShell added in v0.2.0

func (sc *SSHClient) RunInteractiveShell(address string)

RunInteractiveShell 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