sshserver

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package sshserver implements an SSH server terminal TCP middleware.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Forwarding

type Forwarding struct {
	Remote            bool     `cfg:"remote"`
	Local             bool     `cfg:"local"`
	AllowedRemoteBind []string `cfg:"allowed_remote_bind"`
	AllowedLocalDest  []string `cfg:"allowed_local_destination"`
	MaxRemoteForwards int      `cfg:"max_remote_forwards"`
	MaxConnections    int      `cfg:"max_connections"`
}

type SFTP

type SFTP struct {
	Enabled   bool   `cfg:"enabled"`
	Directory string `cfg:"directory"`
	ReadOnly  bool   `cfg:"read_only"`
}

SFTP uses Turna's OS permissions. Directory is a working directory, not a filesystem jail; absolute paths remain available subject to those permissions.

type SSHServer

type SSHServer struct {
	HostKeys []string `cfg:"host_keys" log:"-"`
	Banner   string   `cfg:"banner"`
	Users    []User   `cfg:"users"`
}

func (*SSHServer) Middleware

func (m *SSHServer) Middleware(ctx context.Context, name string) (tcpmw.Middleware, error)

type Shell

type Shell struct {
	Enabled   bool     `cfg:"enabled"`
	Command   string   `cfg:"command"`
	OSUser    string   `cfg:"os_user"`
	AllowExec bool     `cfg:"allow_exec"`
	Env       []string `cfg:"env" log:"-"`
}

type User

type User struct {
	Name               string      `cfg:"name"`
	AuthorizedKeys     []string    `cfg:"authorized_keys"`
	AuthorizedKeyFiles []string    `cfg:"authorized_key_files"`
	Shell              *Shell      `cfg:"shell"`
	SFTP               *SFTP       `cfg:"sftp"`
	Forwarding         *Forwarding `cfg:"forwarding"`
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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