server

package
v1.7.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: MPL-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPort     int = 8022
	DefaultUserPort int = 12023
)

Variables

This section is empty.

Functions

func SweepStaleAgentSockets added in v1.3.1

func SweepStaleAgentSockets()

SweepStaleAgentSockets removes per-connection agent socket directories whose owning process is no longer alive. Liveness is detected via a per-directory flock: the owning process holds an exclusive flock on the lockfile for its lifetime, so any other process that can successfully take the flock knows the original owner is gone.

Call this at the start of every helper ssh-server process: in stdio mode the in-container helper is often SIGKILLed by docker exec when the proxy chain tears down, which skips all deferred cleanup (including ConnectionClosingCallback). Subsequent helper invocations sweep what the dying predecessor couldn't clean up.

Types

type Server

type Server interface {
	Serve(listener net.Listener) error
	ListenAndServe() error
	// Shutdown gracefully closes the listener and waits for active
	// connections to finish, bounded by ctx. Use Close for an immediate
	// termination.
	Shutdown(ctx context.Context) error
}

func NewContainerServer

func NewContainerServer(addr string, workdir string) (Server, error)

func NewServer

func NewServer(
	addr string,
	hostKey []byte,
	keys []ssh.PublicKey,
	workdir string,
	reuseSock string,
) (Server, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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