sshconnect

package
v0.0.5-beta.1 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFromRemoteServer

func CopyFromRemoteServer(client *sftp.Client, srcPath, dstPath, filename string) (*os.File, error)

CopyFromRemoteServer uses sftp to copy a file from a remotes server to a local directory.

func NewClient

func NewClient(kp *keypairs.KeyPair, ip string) (*ssh.Client, error)

NewClient creates a new ssh connection to a remote server. It will attempt to connect up to 10 times with a 10-second gap to prevent a crash should the first attempt fail while the server is booting.

func RunRemoteCommand

func RunRemoteCommand(client *ssh.Client, command string) error

RunRemoteCommand uses an existing SSH connect and runs a command on the remote server.

Types

This section is empty.

Jump to

Keyboard shortcuts

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