ssh

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package ssh provides native SSH connectivity over TLS for vers VMs.

This package implements SSH-over-TLS tunneling where SSH connections are established through a TLS connection on port 443. VMs are accessed via DNS hostnames in the format {vm-id}.vm.vers.sh.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PortToString

func PortToString(port int) string

PortToString converts a port number to string for compatibility.

Types

type Client added in v0.5.4

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

Client provides native SSH connectivity over TLS.

func NewClient added in v0.5.4

func NewClient(host, keyPath string) *Client

NewClient creates a new SSH client for the given VM.

func (*Client) Conn added in v0.5.4

func (c *Client) Conn(ctx context.Context) (*ssh.Client, error)

Conn returns a raw SSH connection for use with SFTP. Caller is responsible for closing the returned client.

func (*Client) Connect added in v0.5.4

func (c *Client) Connect(ctx context.Context) (*ssh.Client, error)

Connect establishes an SSH connection over TLS.

func (*Client) DialFunc added in v0.5.4

func (c *Client) DialFunc(ctx context.Context) (func(network, addr string) (net.Conn, error), *ssh.Client, error)

DialFunc returns a function that dials through the SSH connection. This can be used for port forwarding or other tunneling needs.

func (*Client) Download added in v0.5.4

func (c *Client) Download(ctx context.Context, remotePath, localPath string, recursive bool) error

Download copies a remote file or directory to the local host.

func (*Client) Execute added in v0.5.4

func (c *Client) Execute(ctx context.Context, cmd string, stdout, stderr io.Writer) error

Execute runs a command on the remote host.

func (*Client) Interactive added in v0.5.4

func (c *Client) Interactive(ctx context.Context, stdin io.Reader, stdout, stderr io.Writer) error

Interactive runs an interactive shell session with PTY support.

func (*Client) StartSession added in v0.5.4

func (c *Client) StartSession(ctx context.Context) (*Session, error)

StartSession creates a new session for streaming command execution.

func (*Client) Upload added in v0.5.4

func (c *Client) Upload(ctx context.Context, localPath, remotePath string, recursive bool) error

Upload copies a local file or directory to the remote host.

type Session added in v0.5.4

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

Session represents an active SSH session that can be used for streaming.

func (*Session) Close added in v0.5.4

func (s *Session) Close() error

Close closes the session and underlying connection.

func (*Session) Start added in v0.5.4

func (s *Session) Start(cmd string) error

Start starts a command without waiting for it to complete.

func (*Session) Stderr added in v0.5.4

func (s *Session) Stderr() io.Reader

Stderr returns the stderr reader.

func (*Session) Stdin added in v0.5.4

func (s *Session) Stdin() io.WriteCloser

Stdin returns the stdin writer.

func (*Session) Stdout added in v0.5.4

func (s *Session) Stdout() io.Reader

Stdout returns the stdout reader.

func (*Session) Wait added in v0.5.4

func (s *Session) Wait() error

Wait waits for the command to complete.

Jump to

Keyboard shortcuts

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