ssh

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 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 FindAndExecuteCommand added in v0.11.0

func FindAndExecuteCommand(client *ssh.Client, binary string, cmd string, defaultsPaths ...string) (string, error)

FindAndExecuteCommand finds a suitable binary on the SSH target and executes it

func FindBinary added in v0.11.0

func FindBinary(client *ssh.Client, binary string) ([]string, error)

FindBinary searches the SSH target for a suitable binary

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