ssh

package
v0.0.0-...-d91f73c Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2020 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Agent

func Agent() ssh.AuthMethod

Agent tries to connect with the ssh-agent

func ExecuteCommand

func ExecuteCommand(client *ssh.Client, cmd string) (string, error)

ExecuteCommand executes a command in a new SSH session.

func ReadPrivateKey

func ReadPrivateKey(keyPath, password string) (auth ssh.AuthMethod, ok bool)

ReadPrivateKey tries to read an SSH private key file.

func UploadFile

func UploadFile(client *ssh.Client, localName string, remoteName string) error

UploadFile uploads a local file to the remote. Please avoid funky remote file names, since there's no protection against command injection

func WithinSession

func WithinSession(client *ssh.Client, callback sshSessionCallback) error

WithinSession executes a callback function within a new SSH session of the given client.

Types

This section is empty.

Jump to

Keyboard shortcuts

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