sshclient

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: Apache-2.0 Imports: 20 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HostKey

func HostKey(host string) ssh.PublicKey

func ListenNpipe added in v0.4.0

func ListenNpipe(_ *url.URL) (net.Listener, error)

func PublicKey

func PublicKey(path string, passphrase []byte) (ssh.Signer, error)

Types

type Bastion

type Bastion struct {
	Client *ssh.Client
	Config *ssh.ClientConfig
	Host   string
	Port   string
	Path   string
	// contains filtered or unexported fields
}

func CreateBastion

func CreateBastion(_url *url.URL, passPhrase string, identity string, initial net.Conn, connect ConnectCallback) (*Bastion, error)

func (*Bastion) Close

func (bastion *Bastion) Close()

func (*Bastion) Reconnect

func (bastion *Bastion) Reconnect(ctx context.Context) error

type CloseWriteConn added in v0.4.0

type CloseWriteConn interface {
	net.Conn
	CloseWriteStream
}

type CloseWriteStream added in v0.4.0

type CloseWriteStream interface {
	io.Reader
	io.WriteCloser
	CloseWrite() error
}

type ConnectCallback

type ConnectCallback func(ctx context.Context, bastion *Bastion) (net.Conn, error)

type SSHDialer added in v0.4.0

type SSHDialer interface {
	DialContextTCP(ctx context.Context, addr string) (net.Conn, error)
}

type SSHForward added in v0.4.0

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

func CreateSSHForward added in v0.4.0

func CreateSSHForward(ctx context.Context, src *url.URL, dest *url.URL, identity string, dialer SSHDialer) (*SSHForward, error)

func CreateSSHForwardPassphrase added in v0.4.0

func CreateSSHForwardPassphrase(ctx context.Context, src *url.URL, dest *url.URL, identity string, passphrase string, dialer SSHDialer) (*SSHForward, error)

func (*SSHForward) AcceptAndTunnel added in v0.4.0

func (forward *SSHForward) AcceptAndTunnel(ctx context.Context) error

func (*SSHForward) Close added in v0.4.0

func (forward *SSHForward) Close()

func (*SSHForward) Tunnel added in v0.4.0

func (forward *SSHForward) Tunnel(ctx context.Context) (CloseWriteConn, error)

Jump to

Keyboard shortcuts

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