ssh

package
v0.0.0-...-84dbba1 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrKeyFileDeclined = errors.New("user declined key-file generation")
View Source
var ErrNoKeyFound = errors.New("no private key found")

Functions

func GetKey

func GetKey(filepath string) (ssh.Signer, error)

GetKey will fetch the private key at the specified filepath.

func KeyGenerationWizard

func KeyGenerationWizard(defaultFilePath string) (string, error)

KeyGenerationWizard prompts a user if they want to generate a key and generates a pair.

Types

type Client

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

func Connect

func Connect(conf Config) (*Client, error)

Connect to an SSH server using a username and a SSH key.

func (*Client) GetServerInfo

func (ssh *Client) GetServerInfo() error

type Config

type Config struct {
	Hostname    string `json:"hostname"`
	Username    string `json:"username"`
	KeyFilePath string `json:"keyfilePath"`
}

Jump to

Keyboard shortcuts

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