ssh

package
v0.12.6 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2023 License: MIT Imports: 8 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*ssh.Client
	// contains filtered or unexported fields
}

func NewClient

func NewClient(user, host string, privateKey []byte, port int, opts ...ConnectOpt) (*Client, error)

NewClient connects via ssh to host with the given user and authenticates with the privateKey.

Call client.Connect() to actually get the ssh session

func NewClientWithConnection

func NewClientWithConnection(user, host string, privateKey []byte, conn net.Conn, opts ...ConnectOpt) (*Client, error)

NewClientWithConnection connects via ssh to host with the given user and authenticates with the privateKey. a already created net.Conn must be provided. see vpn.Connect howto create such a connection via tailscale VPN

Call client.Connect() to actually get the ssh session

func (*Client) Connect

func (c *Client) Connect(env *Env) error

Connect once a ssh.Client was created, you can connect to it, this call blocks until session is terminated.

type ConnectOpt added in v0.12.6

type ConnectOpt any

func ConnectOptOutputWriter added in v0.12.6

func ConnectOptOutputWriter(out io.Writer) ConnectOpt

type Env

type Env map[string]string

Jump to

Keyboard shortcuts

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