ssh

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(handlerConfig map[string]string) types.Handler

Types

type Action

type Action int
const (
	PasswordAuth Action = iota + 1 // EnumIndex = 1
	KeyAuth      Action = iota + 1 // EnumIndex = 1
)

Declare related constants for each weekday starting with index 1

func (Action) String

func (w Action) String() string

String - Creating common behavior - give the type a String function

type Event

type Event struct {
	*types.BaseEvent
	// contains filtered or unexported fields
}

func NewEvent

func NewEvent(ctx ssh.Context, action Action) *Event

func (*Event) Details added in v0.0.22

func (e *Event) Details() string

func (*Event) Dispatch added in v0.0.22

func (e *Event) Dispatch(cc chan types.InteractionEvent)

Dispatch overrides the promoted BaseEvent.Dispatch so the outer SSH Event (and its concrete Details() / action) is delivered on the channel rather than the embedded BaseEvent pointer.

func (*Event) FilterString added in v0.0.24

func (e *Event) FilterString() string

FilterString returns "SSH <ACTION> <user> from <ip>", e.g. "SSH PasswordAuth root from 10.0.0.5".

func (*Event) Interaction added in v0.1.0

func (e *Event) Interaction() *model.Interaction

Interaction records the SSH auth attempt (target is the username tried) for the DB / web UI.

type Handler

type Handler struct {
	Listener string
	// contains filtered or unexported fields
}

func (*Handler) Name

func (h *Handler) Name() string

func (*Handler) Start

func (h *Handler) Start(app types.App, eventChan chan types.InteractionEvent) error

func (*Handler) Stop added in v0.0.22

func (h *Handler) Stop(ctx context.Context) error

Stop tells the underlying *ssh.Server to shut down. ctx bounds how long in-flight sessions have to drain. Safe to call before Start or multiple times.

Jump to

Keyboard shortcuts

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