sshutil

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package sshutil provides shared SSH server scaffolding used by sshserver and headend.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Listen

func Listen(ln net.Listener, addr, label string) (net.Listener, error)

Listen creates a listener and logs the address. If ln is non-nil, uses it.

func Serve

func Serve(ln net.Listener, cfg *ssh.ServerConfig, handler SessionHandler) error

Serve accepts connections on ln and dispatches sessions to handler. Returns nil when ln is closed.

func ServerConfig

func ServerConfig(user, pass string) (*ssh.ServerConfig, error)

ServerConfig creates an ssh.ServerConfig with ed25519 host key and password authentication.

Types

type SessionHandler

type SessionHandler func(ch ssh.Channel, reqs <-chan *ssh.Request)

SessionHandler is called for each accepted session channel.

Jump to

Keyboard shortcuts

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