ssh2

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package ssh2 provides functions for interacting with a SSH server.

Index

Constants

View Source
const (
	DefaultPort    = 22
	DefaultTimeout = 5 * time.Second

	SchemeSSH  = "ssh"
	SchemeSFTP = "sftp"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*ssh.Client
}

func Dial

func Dial(uri string, options ...ClientOption) (*Client, error)

Dial returns a Client for the SSH server at a given SSH or SFTP URI. The ClientOption options are processed after the authority from the URI.

Dial returns an error if the address cannot be dialed, the userinfo cannot be parsed, the user and password are invalid, or the file cannot be retrieved.

type ClientConfig

type ClientConfig struct {
	ssh.ClientConfig
}

type ClientOption

type ClientOption func(config *ClientConfig) error

type PrivateKey

type PrivateKey interface {
	ssh.Signer
}

func LoadPrivateKey

func LoadPrivateKey(path string) (PrivateKey, error)

Jump to

Keyboard shortcuts

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