gossh

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeClientConfig added in v1.0.0

func MakeClientConfig(username string, auth []ssh.AuthMethod) *ssh.ClientConfig

MakeClientConfig makes a new ssh.ClientConfig.

func PasswordKey

func PasswordKey(username, password string) *ssh.ClientConfig

PasswordKey returns the ssh.ClientConfig based on specified username and password.

func PrivateKey

func PrivateKey(username, path string) (*ssh.ClientConfig, error)

PrivateKey loads a public key from "path" and returns a SSH ClientConfig to authenticate with the server.

func PrivateKeyPassphrase

func PrivateKeyPassphrase(username, passphrase, path string) (*ssh.ClientConfig, error)

PrivateKeyPassphrase returns the ssh.ClientConfig based on specified username, passphrase and path.

Types

type Connect added in v1.0.0

type Connect struct {
	// Client *ssh.Client
	Client *ssh.Client

	// ProxyDialer
	ProxyDialer proxy.Dialer
}

Connect structure to store contents about ssh connection.

func (*Connect) Close added in v1.0.0

func (c *Connect) Close() error

Close closes the ssh client.

func (*Connect) CreateClient added in v1.0.0

func (c *Connect) CreateClient(addr string, cc *ssh.ClientConfig) error

CreateClient connects to the remote SSH server, returns error if it couldn't establish a session to the SSH server.

Jump to

Keyboard shortcuts

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